web

web

  • NA
  • 6
  • 0

reflecting changes of DataTable to Database

Dec 7 2006 12:04 PM
Hi All, Ive spent days breaking my head over why the code below doesnt update changes to the database. Could someone please help... CODE: OleDbDataAdapter adp = new OleDbDataAdapter("select * from TestTable", connection ); adp.InsertCommand = new OleDbCommandBuilder(adp).GetInsertCommand(); DataTable dt_dst = new DataTable("TestTable"); adp.Fill(dt_dst); DataRow rw = dt_dst.NewRow(); rw["ID"] =123; rw["CAT_ID"] = "adadas"; dt_dst.Rows.Add(rw); dt_dst.AcceptChanges(); adp.Update(dt_dst);