|
-
Mar 24th, 2004, 06:22 AM
#1
Thread Starter
Addicted Member
old value in dataset
How does dataset stores old value?
Suppose we have changed several records and when do we save the recrds it sends the update command to database with new changed and old values.
-
Mar 24th, 2004, 09:33 AM
#2
Member
If I remember correctly it works like this:
When you make changes to a row in a datatable the row's rowstate property i changed to "modified" and if you delete the row it actually is not removed but just marked as "deleted" in the rowstate property. When the dataset is updated against the database it updates the database with the modifications on all rows that are not marked as "unchanged" in the rowstate property.
This should mean that it does not store the old data, it changes the data and marks the row as "modified" and when updating to db does the update with a big, kinda complex UPDATE query.
Anyone feel free to correct me if I'm remembering incorrectly.
/Nisse
-
Mar 25th, 2004, 01:00 AM
#3
Thread Starter
Addicted Member
old value in dataset
Thanks for the answer.
But I found that the updatequery is something like
update table set fld1=?,.......
where fld1=?,.......
to execute this query we should pass the new changed value before "where" field1=newvalye,... and should pass the old value
after "where" where field1=oldvalue and ...........
-
Mar 25th, 2004, 09:24 AM
#4
Member
You are correct, I had a memory flaw I guess. =)
If you use .NET to build a update command it will use 2 sets of parameters, one set with "new values" and one set with "original values". Those parameters differs in the SourceVersion property, current or original.
I almost always work with typed datasets so all this is done in the background.
/Nisse
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|