dreid

dreid

  • NA
  • 1
  • 0

propagating changes with SqlCeDataAdapter?

Jun 6 2004 12:56 PM
Hi, I'm trying to simply update my database with changes that I make to my DataSets, and it doesn't seem to be working (specifically this delete attempt). I'm new to this class so I was hoping someone could point out any mistake in my code, or point me to a good tutorial on this topic. Thank you for your time. In the following code, I'm simply attempting to delete the first entry in my tblCustomer table. The change seems to be taking place in the dataset itself, but when I try to accept the changes and propagate the delete, the database does not reflect the delete. [code] SqlCeDataAdapter daTest = new SqlCeDataAdapter("Select * from tblCustomer", cnRoofWeb); DataSet dsTest = new DataSet(); DataTable dtTest = new DataTable("tblCustomer"); daTest.Fill(dsTest); dtTest = dsTest.Tables[0]; DataRow[] drRows = dtTest.Select("Id = 1"); dsTest.Tables[0].Rows.Remove(drRows[0]); dsTest.AcceptChanges(); [/code]