Oledb Exception was un handled

Posted by Ssateesh under C# on 9/24/2012 | Points: 10 | Views : 941 | Status : [Member] | Replies : 4
hi,

i am getting an error that Oledb Exception was un handled , Syntax error in UPDATE statement.
this is my query
OleDbCommand cmd1 = new OleDbCommand("update adminLogin set password=' " + textBox3.Text + " ' where name=' " + label6.Text +" ', con);
con.Open();
cmd1.ExecuteNonQuery();
con.Close();




Responses

Posted by: Perumal93 on: 9/24/2012 [Member] Starter | Points: 25

Up
0
Down
What is the error displayed?

Ssateesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 9/24/2012 [Member] Starter | Points: 25

Up
0
Down
what is your error?

Thanks & Regards
Hari

Ssateesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naraayanan on: 9/25/2012 [Member] Starter | Points: 25

Up
0
Down
Hi ,
Try this
Old Code:
"update adminLogin set password=' " + textBox3.Text + " ' where name=' " + label6.Text +" ',Con

New Code:
"update adminLogin set password=' " + textBox3.Text + " ' where name=' " + label6.Text +" '",Con

Semi Colon is missing in your code.Please mark my answer if it is helpful

Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

Ssateesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 9/27/2012 [Member] Starter | Points: 25

Up
0
Down
Thanq Naraayanan

Thanks & Regards
Hari

Ssateesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response