i have defined 2 datasets and 2 dataAdapters( one for each of the datasets ) . after creating, for each of the 2 dataAdapters i define a SqlCommandBuilder. All is well till here. I can add, modify, erase very ok from the database using dataAdapter1.Update(dataSet1) .. BUT not in this order :erase, add,modify.
Here is the code for the first dataset,dataAdapter and sqlCommandBuilder :
string sql = "SELECT * From localitati";
da1 = new System.Data.SqlClient.SqlDataAdapter(sql, con);
da1.Fill(ds1, "localitati");
cmdBuilder1 = new SqlCommandBuilder(da1);
And the second :
sql = "SELECT * From sucursale";
da2 = new System.Data.SqlClient.SqlDataAdapter(sql, con);
da2.Fill(ds2, "sucursale");
//face automat select, insert ,etc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
cmdBuilder2 = new SqlCommandBuilder(da2);
Any ideas why is this happening ?