0
Answer

reflecting changes of DataTable to Database

Ask a question
web

web

17y
1.6k
1
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);