PC Review


Reply
Thread Tools Rate Thread

Using a dataset's rowstate functionality in .net

 
 
GrantMagic
Guest
Posts: n/a
 
      13th Sep 2004
I tend to use the SqlDataAdapter class in WinForms projects because once the
inital data is loaded any modifications can be easily added/updated through
a call to the Update() method. I've found in aspnet that the same thing is
possible but because of the stateless nature of the web in order to do this
I have to go through the following steps:

1. First visit to page loads DataSet and binds DataList with data
2. User edits data and submits the pages
3. Reload the DataSet with original data as in 1.
4. Iterate through the DataList and updates rows in the DataSet
5. Call the Update() method to update edited rows

Now am I doing this correctly or is there any way I can skip step 3? It
seems easier to just update each row in the DataList than go through the
process of only updating modified rows.


 
Reply With Quote
 
 
 
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      13th Sep 2004
Hi,

You might cache the datataset you use for binding - you'll skip 3. then.
Or, you might manually create a dataset (from modified data) and update it.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"GrantMagic" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I tend to use the SqlDataAdapter class in WinForms projects because once
>the
> inital data is loaded any modifications can be easily added/updated
> through
> a call to the Update() method. I've found in aspnet that the same thing
> is
> possible but because of the stateless nature of the web in order to do
> this
> I have to go through the following steps:
>
> 1. First visit to page loads DataSet and binds DataList with data
> 2. User edits data and submits the pages
> 3. Reload the DataSet with original data as in 1.
> 4. Iterate through the DataList and updates rows in the DataSet
> 5. Call the Update() method to update edited rows
>
> Now am I doing this correctly or is there any way I can skip step 3? It
> seems easier to just update each row in the DataList than go through the
> process of only updating modified rows.
>



 
Reply With Quote
 
GrantMagic
Guest
Posts: n/a
 
      13th Sep 2004
ok, thanks

How will that effect multiple users.
Will they each get their own section in the cache, or will the same cache
get utilised?


"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:%(E-Mail Removed)...
> Hi,
>
> You might cache the datataset you use for binding - you'll skip 3. then.
> Or, you might manually create a dataset (from modified data) and update
> it.
>
> --
> Miha Markic [MVP C#] - RightHand .NET consulting & development
> miha at rthand com
> www.rthand.com
>
> "GrantMagic" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I tend to use the SqlDataAdapter class in WinForms projects because once
>>the
>> inital data is loaded any modifications can be easily added/updated
>> through
>> a call to the Update() method. I've found in aspnet that the same thing
>> is
>> possible but because of the stateless nature of the web in order to do
>> this
>> I have to go through the following steps:
>>
>> 1. First visit to page loads DataSet and binds DataList with data
>> 2. User edits data and submits the pages
>> 3. Reload the DataSet with original data as in 1.
>> 4. Iterate through the DataList and updates rows in the DataSet
>> 5. Call the Update() method to update edited rows
>>
>> Now am I doing this correctly or is there any way I can skip step 3? It
>> seems easier to just update each row in the DataList than go through the
>> process of only updating modified rows.
>>

>
>



 
Reply With Quote
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      13th Sep 2004
Hi Grant,

That depends on you as you have several options to cache it. :-)
For example, if you store it within session then it is per user, if you
store it in the cache then it is global.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"GrantMagic" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> ok, thanks
>
> How will that effect multiple users.
> Will they each get their own section in the cache, or will the same cache
> get utilised?
>
>
> "Miha Markic [MVP C#]" <miha at rthand com> wrote in message
> news:%(E-Mail Removed)...
>> Hi,
>>
>> You might cache the datataset you use for binding - you'll skip 3. then.
>> Or, you might manually create a dataset (from modified data) and update
>> it.
>>
>> --
>> Miha Markic [MVP C#] - RightHand .NET consulting & development
>> miha at rthand com
>> www.rthand.com
>>
>> "GrantMagic" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>I tend to use the SqlDataAdapter class in WinForms projects because once
>>>the
>>> inital data is loaded any modifications can be easily added/updated
>>> through
>>> a call to the Update() method. I've found in aspnet that the same thing
>>> is
>>> possible but because of the stateless nature of the web in order to do
>>> this
>>> I have to go through the following steps:
>>>
>>> 1. First visit to page loads DataSet and binds DataList with data
>>> 2. User edits data and submits the pages
>>> 3. Reload the DataSet with original data as in 1.
>>> 4. Iterate through the DataList and updates rows in the DataSet
>>> 5. Call the Update() method to update edited rows
>>>
>>> Now am I doing this correctly or is there any way I can skip step 3? It
>>> seems easier to just update each row in the DataList than go through the
>>> process of only updating modified rows.
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dataset updated ...but rowstate not Gabriel Microsoft Dot NET Framework Forms 0 29th May 2006 04:57 PM
q; DataSet RowState unchanged =?Utf-8?B?SklNLkgu?= Microsoft ASP .NET 1 24th May 2006 11:41 PM
dataset and rowstate Sam Microsoft VB .NET 1 9th Aug 2005 11:59 AM
Re: Dataset and Rowstate William Ryan eMVP Microsoft ADO .NET 0 2nd Jun 2004 09:53 PM
Changing dataset rowstate sahridhayan Microsoft ADO .NET 1 12th Jan 2004 02:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:42 PM.