Hi all,
I had a problem in updating a record in ms access.I wrote the same query in another project which is working correctly.But in another project it is giving error like
'Syntax error in Update Statement'
Please give me a solution for that,here is the query
string ConnectionString = ConfigurationManager.AppSettings["myconstring"];
OleDbConnection con = new OleDbConnection();
con.ConnectionString = ConnectionString;
con.Open();
string query_updatecust = "update tbl_customer set cust_name='" + txt_customer_name.Text.Trim() + "', cust_opno='" + txt_opno.Text.Trim() + "', addr1='" + txt_address1.Text.Trim() + "', addr2='" + txt_address2.Text.Trim() + "', addr3='" + txt_address3.Text.Trim() + "', contact_no='" + txt_contactno.Text.Trim() + "', note='" + txt_note.Text.Trim() + "' where cust_num='" + txt_custnum.Text.Trim() + "'";
OleDbCommand cmd_updatecust = new OleDbCommand(query_updatecust, con);
int val = cmd_updatecust.ExecuteNonQuery();
con.Close();