i write following code to update database but every time i got update syntax error is anyone help me to ..
MessageBox.Show("the password is matched");
String conString = "Provider=Microsoft.Jet.OLEDB.4.0;"
+ "Data Source=C:\\Documents and Settings\\Wasif\\My Documents\\studentLogin.mdb";
OleDbConnection empConnection = new OleDbConnection(conString);
String insertStatment = "UPDATE StudentLoginData Set ID='" + this.txt_id.Text + "', username='" + this.txt_username.Text + "', password='" + this.txt_password.Text + "' WHERE ID="+this.txt_id.Text+";";
OleDbCommand insertCommand = new OleDbCommand(insertStatment, empConnection);
//insertCommand.Parameters.Add("ID", OleDbType.Char).Value = strID;
//insertCommand.Parameters.Add("username", OleDbType.Char).Value = strusername;
//insertCommand.Parameters.Add("password", OleDbType.Char).Value = strpassword;
empConnection.Open();
try
{
int count = insertCommand.ExecuteNonQuery();
}
catch (OleDbException o)
{
MessageBox.Show(o.Message);
}
finally
{
empConnection.Close();
}