   Updating the database in .NET(C#) [SOLVED]
  Excuse me for this simple question, but I'm completely new in the .NET environment. I have this simple piece of code:OleDbConnection myConn = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source=C:\\Test.mdb");  myConn.Open();  OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM Table1", myConn);    OleDbCommandBuilder cb = new OleDbCommandBuilder(adapter);  adapter.UpdateCommand = cb.GetUpdateCommand();  adapter.InsertCommand = cb.GetInsertCommand();  adapter.DeleteCommand = cb.GetDeleteCommand(); DataSet ds = new DataSet();  adapter.Fill(ds,"Table1");    ds.Tables["Table1"].Rows.Add("mikeman");  ds.AcceptChanges();  adapter.Update(ds,"Table1");    myConn.Close();It is supposed to establish a connection with "Test.mdb" contaning only 1 table "Table1" with only 1 column "Name"(which is a primary key), use an adapter to populate a dataset, add one row(a new one, "mikeman" does not exist already) and update the database. Everything works, except the last one. Adapter.Update(ds,"Table1") doesn't seem to do anything. The database is not updated. Where am I going wrong here?Thanks in advance.[Edited by - mikeman on December 11, 2005 11:23:46 AM]
  Nevermind, I found the problem. It seems I must not call ds.AcceptChanges() before adapter.Update(). It seems that the Update() command affects the rows that are flagged added/modified, and AcceptChanges() clears those flags. It works now.   