Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issue Comparing DataSets

Status
Not open for further replies.

jmikow

Programmer
Mar 27, 2003
114
US
I have a webapp that I am currently trying to finish up and need some additional eyes to tell me what is happening.

We are using 2 DataSets that derive from the same typed dataset. The reason for this is that we want to compare when individual columns change, not just a row, and make the font red if the data has changed.

DataSet A is populated from our datasource and DataSet B is simply a copy of DataSet A.

I know my comparison of data works, since the color would change before I started writing data back to DataSet A.

I've run into a situation where as soon as I try to write back to DataSet A and save the user's changes (from textboxes) it appears to save the changes to DataSet B at the same time. This renders my checking of the data against the original useless since it always appears to be the same data, and therefore never changes the font to red.

I can post the code from my webapp if you would like, but it's almost 2000 lines of code.

Please let me know if you have any idea what I could do to fix this issue as it is one of the last things that is needed.

Thanks ahead of time,

Josh
 
How are you obtaining your copy of DataSet A? Are you just doing a Fill from the DataAdapter, or are you using DataSet A's Copy() method?


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
To populate DataSet A I am using the DataAdapter.Fill(DataSetA.TableName) method.

To populate DataSet B I was doing a DataSetB = DataSetA

Should I be populating DataSet B differently?

Thanks,

Josh
 
Thanks for that help.

It fixed the problem I as having. I just needed to change the way I was populating my DataSetB to use the .copy() method.

Thanks again!

Josh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top