I\'m sure there is an extremely simple reason that this one line isn\'t working, but it has evaded for the past week, so I\'m hoping someone else will notice my fault.
You might need
DataAdapeter.AcceptChanges()
Adding AcceptChangesDuringUpdate before Update works for me, example :
foreach (string tableName in tableNames)
{
da = new SqlDataAdapter("SELECT * FROM " + tableName, cn);
cb = new SqlCommandBuilder(da); //initialise the update, insert and delete commands of da
da.AcceptChangesDuringUpdate = true;
da.Update(myDataSet, tableName);
}
I have encountered the same problem. My dataadapter.fill works but dataadapter.update does not work. I realised the problem was that my database table does not contain a primary key. After I modified my table to include a column with primary key, dataadapter.fill works. Hope this helps someone.