Click here to Skip to main content
15,886,664 members

Comments by abbasnafiu (Top 2 by date)

abbasnafiu 6-Apr-13 10:43am View    
i use win 7 32 bit : home premium
abbasnafiu 1-Jan-13 15:35pm View    
this is my code statement

OleDbConnection myConnection2 = new OleDbConnection(con);
//string stUpd = "update std2 +"set names=+txtNm.Text+ ,schs= +txtSch.Text+" + where ids=+txtId.Text+";
string stUpd = "update std2 set [names]='" + txtNm.Text + "' ,schs= '" + txtSch.Text + " where ids=txtId.Text";
myConnection2.Open();
OleDbCommand stCmd2 = new OleDbCommand(stUpd, myConnection2);
stCmd2.ExecuteNonQuery();
myConnection2.Close();
MessageBox.Show("updated");

after debugging it highlights stCmd2.ExecuteNonQuery();

and the error statement is: THE UPPDATE SYNTAX IS INCORRECT