Hi All,
I am using visual studio 2005 and Access 2007.
I want to update a table in access 2007 using C#.net.
I have written the following code but it doesn't seem to work and neither does it throw any error.
OleDbCommand updateTransactionCost = new OleDbCommand();
updateTransactionCost.Connection = Module1.oledbcon;
updateTransactionCost.CommandText = "Update Transactions set Total_Transaction_Cost = @amount,Transaction_Printed = @Print where Transaction_ID = @Transaction_ID";
updateTransactionCost.Parameters.Add("@amount", OleDbType.VarChar);
updateTransactionCost.Parameters.Add("@Transaction_ID", OleDbType.VarChar);
updateTransactionCost.Parameters.Add("@Print", OleDbType.Boolean);
updateTransactionCost.Parameters["@amount"].Value = totalTransactionAmount;
updateTransactionCost.Parameters["@Transaction_ID"].Value = Transaction_ID;
updateTransactionCost.Parameters["@Print"].Value = Print;
updateTransactionCost.ExecuteNonQuery();
Probably it doesn't have privileges or something else.