Dataset to Sql Server Ce

C

cox

How can I take a erived dataset and populate a sql server ce database table
that matches the dataset.

I understand the concept of taking a table (ex. via sql) from sql server ce
and using a data adapter to fill a dataset...now how can I reverse the
process.
 
W

William Ryan eMVP

use the DataAdapter.Update on it. Just make sure the rowstate or each of
the rows in Added. Then when update is called, it will fire your Update
Command on the row mapping the row values to the params in the update
command.. If you are filling it from somewhere else, set the
..AcceptChangesDuringFill property to false when you do this this way the
rows will all look like they've been added. If you serialize it to xml,use
the diffgram option which will save the state. Then you can deserialize it
with the state in tact, and just call update. If you have a valid Insert
Command (and Delete/Modify if you are doing that), all you need to do is
call update.
 

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

Top