Getting Original Values For Update

  • Thread starter Thread starter Bradley M. Small
  • Start date Start date
B

Bradley M. Small

Hi --

I am using webmatrix so whatever I try and do is determined by what I can do
by hand. That said, I am trying to figure out how to get the original values
for a field that is being edited.

What I have is a table that had 2 fields in it. Let's say Field1 and Field2.
The key to the table is Field1, Field2 so the ddl would look like this:

create table MyTable (
Field1 varchar(10) not null
,Field2 varchar(10) not null
)

I have created a datagrid to edit it however, if someone changes either
value the update statement needs to know what both the original values were.
I have considered making my select statement get both fields twice and
setting the columns for the second set in the datagrid to not visible, but
then I can't seem to figure out how to get the hidden values when someone
presses the Update.

All in all I jus figured that it was getting too involved to be doing it
correctly, so I thought I'd just ask...

-- Bradley
 
Bradley,

Check out the .HasVersion property of DataRow class
You can retreive Original, Current and Proposed values of the DataRowVersion

Stephen
 
Then I guess the question is how do I use and access a DataTable instead of
a DataSet in my DataGrid?

Am I even thinking along the correct lines?

-- B
 
Back
Top