J
JamesB
Not sure if you'll be able to help as I'm using an inherited database
connection that one of our devs wrote... but in any case...
I'm trying to add a new row to a table, using the following code (the below
is simplified)
DataTable tblImport = myConn.OpenTable("SELECT * FROM table);
DataRow NewRow = tblImport.NewRow();
NewRow["fieldA"] = "foo";
NewRow["fieldB"] = "bar";
NewRow.AcceptChanges();
tblImport.AcceptChanges();
After all this, my data never appears in the database. There are no errors
etc (i've removed the try-catch lines to see if it bombs out, but runs
through fine).
Is that methodology correct though? Or do I need to have a dataadapter in
there etc?
connection that one of our devs wrote... but in any case...
I'm trying to add a new row to a table, using the following code (the below
is simplified)
DataTable tblImport = myConn.OpenTable("SELECT * FROM table);
DataRow NewRow = tblImport.NewRow();
NewRow["fieldA"] = "foo";
NewRow["fieldB"] = "bar";
NewRow.AcceptChanges();
tblImport.AcceptChanges();
After all this, my data never appears in the database. There are no errors
etc (i've removed the try-catch lines to see if it bombs out, but runs
through fine).
Is that methodology correct though? Or do I need to have a dataadapter in
there etc?