syntax error
-
when i run my application, the program hinted me.. highlighting commandObj2.ExecuteNonQuery(); telling me it have a syntax error near ''.. i was puzzle as to where this error comes from, or where did i go wrong. -DarkangeL-
What Error it gives.............
-
when i run my application, the program hinted me.. highlighting commandObj2.ExecuteNonQuery(); telling me it have a syntax error near ''.. i was puzzle as to where this error comes from, or where did i go wrong. -DarkangeL-
-
when i run my application, the program hinted me.. highlighting commandObj2.ExecuteNonQuery(); telling me it have a syntax error near ''.. i was puzzle as to where this error comes from, or where did i go wrong. -DarkangeL-
Inspect the commandObject.commandText property. That should give you some guideline. Vasudevan Deepak Kumar Personal Web: http://www.lavanyadeepak.tk/ I Blog At: http://www.dotnetjunkies.com/weblog/deepak/
http://deepakvasudevan.blogspot.com/
http://deepak.blogdrive.com/ -
when i run my application, the program hinted me.. highlighting commandObj2.ExecuteNonQuery(); telling me it have a syntax error near ''.. i was puzzle as to where this error comes from, or where did i go wrong. -DarkangeL-
debug it and copy the sql query and run it in sql query analyzer to see if it works... << >>
-
What Error it gives.............
Incorrect syntax near ' '.
Line 716: SqlCommand commandObj2 = new SqlCommand(UpdateData, connectObj2);
Line 717: connectObj2.Open();
Line 718: commandObj2.ExecuteNonQuery();
Line 719: connectObj2.Close();Stack Trace:
[SqlException (0x80131904): Incorrect syntax near ' '.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +95
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +82
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +3244
System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) +272
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +367
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +149
AdminView.Button1_Click(Object sender, EventArgs e) in d:\testApplication\AdminEdit.aspx.cs:718
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +96
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +116
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +72
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3840this is the error page it gives me. -DarkangeL-
-
The error comes from the database, so your error is where you create the sql query. --- b { font-weight: normal; }