CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 how to determine wheter is insert or update

Print topic Send  topic

Author Message
bogdantc

Posts: 36
Posted: 12/11/2007, 12:23 AM

hello,

I am using ASP .NET 2.0 (C#) but I think this could be something relevant for every technology so this is why I am posting it here.

Situation: I want to track every validation errors which happen especially when users insert data. For this I use OnValidate event to capture the error and to insert it in the database.

Problem: I can not or at least I don't know how to determine if it is a new record or just an update of a previous record. OnValidate is located on the DataProvider section and not in the Page.aspx.cs code. So I can not use IsInsertMode or IsEditMode :( I can not use neither Request.QueryString to see if there is a parameter sent to the page and to know that I am updating a record :(

thanks in advance for any help,
bogdan
_________________
Able was I ere I saw Elba
View profile  Send private message
bogdantc

Posts: 36
Posted: 12/19/2007, 3:55 AM

is there no one out there to know how to determine if it is the Update or the Insert operation in the DataProvider cs file?
_________________
Able was I ere I saw Elba
View profile  Send private message
DonB
Posted: 12/19/2007, 6:04 AM

Have a look at the operation() method of your Record/Editable Grid and you
will see how CCS sorts it out.

--
DonB

http://ccswiki.gotodon.net


"bogdantc" <bogdantc@forum.codecharge> wrote in message
news:24769069f32fb1@news.codecharge.com...
> is there no one out there to know how to determine if it is the Update or
the
> Insert operation in the DataProvider cs file?
> _________________
> Able was I ere I saw Elba
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>

Tuong Do
Posted: 01/09/2008, 9:12 PM

Hi bogdan

Use

If Me.isnew() Then


End If


"bogdantc" <bogdantc@forum.codecharge> wrote in message
news:2475e48efbac08@news.codecharge.com...
> hello,
>
> I am using ASP .NET 2.0 (C#) but I think this could be something relevant
> for
> every technology so this is why I am posting it here.
>
> Situation: I want to track every validation errors which happen especially
> when
> users insert data. For this I use OnValidate event to capture the error
> and to
> insert it in the database.
>
> Problem: I can not or at least I don't know how to determine if it is a
> new
> record or just an update of a previous record. OnValidate is located on
> the
> DataProvider section and not in the Page.aspx.cs code. So I can not use
> IsInsertMode or IsEditMode :( I can not use neither Request.QueryString
> to see
> if there is a parameter sent to the page and to know that I am updating a
> record
> :(
>
> thanks in advance for any help,
> bogdan
> _________________
> Able was I ere I saw Elba
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>

bogdantc

Posts: 36
Posted: 01/14/2008, 2:13 AM

:(
Compiler Error Message: CS0103: The name 'Me' does not exist in the current context
_________________
Able was I ere I saw Elba
View profile  Send private message
bogdantc

Posts: 36
Posted: 01/14/2008, 2:44 AM

OK I got it :D Thanks Tuong Do!

I'm using C# but that was not the problem although I had to be sure I write IsNew and not isnew.

CCS is already generating himself IsNew property so all I had to do was to use it like this

if(IsNew)   
{   
//do something;   
}

_________________
Able was I ere I saw Elba
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.