Getting Original Values For Update

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
 
S

Stephen Muecke

Bradley,

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

Stephen
 
B

Bradley M. Small

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top