aspnet c# objCmd.ExecuteNonQuery(); error why can anyone help
The error below is on my server using odbc drivers for access but on local and on my server I am recieving this error can anyone tell me why
example link also: http://anointedvesseldanceministry.o.../Default5.aspx
try to update and you will see the error.
http://anointedvesseldanceministry.o.../Default5.aspx
Syntax error in UPDATE statement.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Syntax error in UPDATE statement.
Source Error:
Line 65: objCmd.Parameters.Add("@textbox1", txttextbox1.Text);
Line 66: objConn.Open();
Line 67: objCmd.ExecuteNonQuery();
Line 68: objConn.Close();
Anyhow, .NET is very good at telling you what your error is, you just need to read it right. In your case, there is a syntax error in your update statement that must be addressed. Presuming you are using SQL server, the best thing to do is to copy the SQL command into the appropriate SQL server tool (management studio or Query Analyizer depending on version) and check the syntax. IT should help you pin things down.
Bookmarks