syntax error in update statement
-
Sir, I am using the update query and there is occuring the problem There is a syntax error in update statement. str = "Provider = Microsoft.jet.Oledb.4.0;Data Source =" + Server.MapPath("\sandeep\sujok\sujok.mdb") con = New OleDbConnection(str) con.Open() Dim sdd As String = "Update admin Set password ='" & TextBox3.Text & "' where user_id = '" & TextBox1.Text & "' and password = '" & TextBox2.Text & '" cmd = New OleDbCommand(sdd, con) cmd.ExecuteNonQuery() con.Close Please sort out the problem Plese send me some code if possible Thanks and Regards sandeep Thakur -- modified at 4:27 Friday 19th May, 2006
-
Sir, I am using the update query and there is occuring the problem There is a syntax error in update statement. str = "Provider = Microsoft.jet.Oledb.4.0;Data Source =" + Server.MapPath("\sandeep\sujok\sujok.mdb") con = New OleDbConnection(str) con.Open() Dim sdd As String = "Update admin Set password ='" & TextBox3.Text & "' where user_id = '" & TextBox1.Text & "' and password = '" & TextBox2.Text & '" cmd = New OleDbCommand(sdd, con) cmd.ExecuteNonQuery() con.Close Please sort out the problem Plese send me some code if possible Thanks and Regards sandeep Thakur -- modified at 4:27 Friday 19th May, 2006
Hi Sandeep, you use like this Dim sdd As String = "Update admin Set password ='" & TextBox3.Text & "' where user_id = '" & TextBox1.Text & "' and password = '" & TextBox2.Text & "'" Hope this will help. But this is not the correct way by this you are giving a chance for sql injection. Use parameters for this. Best Regards, Apurva Kaushal
-
Hi Sandeep, you use like this Dim sdd As String = "Update admin Set password ='" & TextBox3.Text & "' where user_id = '" & TextBox1.Text & "' and password = '" & TextBox2.Text & "'" Hope this will help. But this is not the correct way by this you are giving a chance for sql injection. Use parameters for this. Best Regards, Apurva Kaushal
Thanks But There is same problem Error is --- ( syntex error in UPDATE statement) Please help me
-
Thanks But There is same problem Error is --- ( syntex error in UPDATE statement) Please help me
-
Thank You very much i found the solution once again thank you