Hi All,
I have a C# test app that writes to an access database with the following code
The Update Query I use is
Before I do the update the database holds this information
And after I do the update I see this in the Database
Where I would expect it to hold
As I can see that the data held in the C# DataSet is what I think it should be I assume that it's something to do with access parameters not cleaning up properly in between updates.
Anyone seen anything like this before?
Thanks
I have a C# test app that writes to an access database with the following code
Code:
DataRow editRow1 = ds.Tables["TraderNames"].Rows.Find("1"); DataRow editRow2 = ds.Tables["TraderNames"].Rows.Find("2"); editRow2["TraderName"] = "Bob"; editRow1["TraderName"] = "AAAAAAA"; update.Parameters.Clear(); update.Parameters.Add("@TName", OleDbType.Char, 20, "TraderName"); update.Parameters.Add("@TNum", OleDbType.Char, 20, "TraderNum"); update.Parameters.Add("@ID", OleDbType.Char, 20, "TraderID"); int numRows = adapter.Update(ds.Tables["TraderNames"]);
Code:
UPDATE Traders SET TraderName = [@TName], TraderNum = [@TNum] WHERE TraderID=[@ID];
Before I do the update the database holds this information
Code:
TraderID TraderName TraderNum 1 David 20 2 Hamish 11
Code:
TraderID TraderName TraderNum 1 AAAAAAA 20 2 BobAAAA 11
Code:
TraderID TraderName TraderNum 1 AAAAAAA 20 2 Bob 11
Anyone seen anything like this before?
Thanks
Comment