468,539 Members | 1,480 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,539 developers. It's quick & easy.

Incorrect syntax near the keyword 'user'

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.SqlClient.SqlException: Incorrect syntax near the keyword 'user'.

Source Error:


Line 35: MyAdapter1 = new SqlDataAdapter(MyCommand1);
Line 36: MyDataSet1 = new DataSet();
Line 37: MyAdapter1.Fill(MyDataSet1);
Line 38:
Line 39: if (MyDataSet1.Tables[0].Rows.Count == 1)


Source File: c:\Documents and Settings\karen\My Documents\Visual Studio 2005\WebSites\WebSite1\login.aspx.cs Line: 37

Stack Trace:


[SqlException (0x80131904): Incorrect syntax near the keyword 'user'.]
System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception, Boolean breakConnection) +177
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +68
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj) +199
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2305
System.Data.SqlClient.SqlDataReader.ConsumeMetaDat a() +31
System.Data.SqlClient.SqlDataReader.get_MetaData() +62
System.Data.SqlClient.SqlCommand.FinishExecuteRead er(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +294
System.Data.SqlClient.SqlCommand.RunExecuteReaderT ds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1021
System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +314
System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +20
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior behavior, String method) +107
System.Data.SqlClient.SqlCommand.ExecuteDbDataRead er(CommandBehavior behavior) +10
System.Data.Common.DbCommand.System.Data.IDbComman d.ExecuteReader(CommandBehavior behavior) +7
System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +139
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +140
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +82
login.btnLogin_Click(Object sender, EventArgs e) in c:\Documents and Settings\karen\My Documents\Visual Studio 2005\WebSites\WebSite1\login.aspx.cs:37
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +75
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +97
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4921

Anything wrong with the code? Or any code that I need to add?
Mar 6 '08 #1
1 5032
kunal pawar
297 100+
I think Error is in ur sql Command, which u passed to sqlcomand object.
Mar 6 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Jeff Magouirk | last post: by
2 posts views Thread by Roger R. Smith | last post: by
11 posts views Thread by Mark Findlay | last post: by
2 posts views Thread by ielmrani via SQLMonster.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.