Merging typed datasets

  • Thread starter Thread starter liam
  • Start date Start date
L

liam

I have two typed datasets, ds1 and ds2.

ds1 is the original dataset.

ds2 is another dataset with some updates.

I call:

ds1.Merge(ds2, False)
ds1.AcceptChanges()

But the information in ds2 has not be transferred to
ds1! Is there anything that I am missing here?

thanks,

liam
 
Really can't tell why exactly why this is happening without being able to
see datasets. But ds1 will sort of "override" ds2's changes. So you might
want to tweak primary keys, rowstates etc to get the desired results.

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/
 
hello

You can try looking at the link i have below, i had the same trouble and
there was something about giving both datsets the same name before they would
merge,

MyCommand = new SqlDataAdapter("exec s_get_table1", MyConnection)
DS1 = new DataSet()
MyCommand.Fill(DS1, "MyTable")

MyCommand = new SqlDataAdapter("exec s_get_table2", MyConnection)
DS2 = new DataSet()
MyCommand.Fill(DS2, "MyTable")

ds1.merge(ds2)



http://aspalliance.com/articleViewer.aspx?aId=148&pId
 

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

Back
Top