Need help using tableadapter update to save imported xml data back to sql server compact 3.5 database.
Posted on 2008-11-17
I need to be able to add import/export functionality to an application so that several users can keep their data "sync'ed" up. The users will never be connected to the same network, and an "online" server is not a feasable option.
I use a typed dataset for the data application and can write it out to xml. I thought that perhaps I could use the dataset.ReadXml function and then do an update on the table adapters to get this data into another users database.
New records are inserted just fine (based on primary keys). However, how do I get the tableadapter to update the database on changed records.
Here is the import code:
loomixDataSet ds = new loomixDataSet();
string _connstr = Properties.Settings.Default.connstr;
//ds.EnforceConstraints = false;
ProductsTableAdapter prods = new ProductsTableAdapter();
prods.Connection.ConnectionString = _connstr;
foreach(DataRow dr in ds.Products)
I am looking for some code to insert into the catch block to force the table adapter to call the update command instead of an insert command.