Machaira
Well-known member
OK, Im stumped on this. Ive got an ASP.NET 2.0 page with a DetailsView on it, tied to a SQLDataSource.
Heres the SQL Server 2000 data table Im using:
[dbo].[CDRL Infromation] (
[cdrlID] [int] IDENTITY (1, 1) NOT NULL ,
[OPFI #] [varchar] (255)
[DID #] [varchar] (50)
[Field Instruction Title] [varchar] (255)
[Gov Lead] [varchar] (255)
[Due] [varchar] (100)
[Next Due Date] [datetime]
[Current Rev Date] [datetime]
[Current Rev] [float]
[SME] [varchar] (255)
[TECH WRITER] [varchar] (255)
[Days to Next Update] [int]
Heres the SELECT and UPDATES for the data source:
SELECT * FROM [CDRL Infromation] WHERE ([cdrlID] = @cdrlID2)
UPDATE [CDRL Infromation] SET [OPFI #] = @column1, [DID #] = @column2, [Field Instruction Title] = @Field_Instruction_Title, [Gov Lead] = @Gov_Lead, [Due] = @Due, [Next Due Date] = @Next_Due_Date, [Current Rev Date] = @Current_Rev_Date, [Current Rev] = @Current_Rev, [SME] = @SME, [TECH WRITER] = @TECH_WRITER, [Days to Next Update] = @Days_to_Next_Update WHERE [cdrlID] = @original_cdrlID
I attempt to edit a record and when I click the Update link on the detailsview I get:
Line 1: Incorrect syntax near nvarchar.
Line 1: Incorrect syntax near ,.
Line 1: Incorrect syntax near ).
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: Line 1: Incorrect syntax near nvarchar.
Line 1: Incorrect syntax near ,.
Line 1: Incorrect syntax near ).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Line 1: Incorrect syntax near nvarchar.
Line 1: Incorrect syntax near ,.
Line 1: Incorrect syntax near ).]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857354
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734966
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +149
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +415
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +401
System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +721
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +78
System.Web.UI.WebControls.DetailsView.HandleUpdate(String commandArg, Boolean causesValidation) +1152
System.Web.UI.WebControls.DetailsView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +461
System.Web.UI.WebControls.DetailsView.OnBubbleEvent(Object source, EventArgs e) +95
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.DetailsViewRow.OnBubbleEvent(Object source, EventArgs e) +109
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +163
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Where the heck is the nvarchar coming from?!? Ive tried looking at the data in the ItemUpdating event but it doesnt really present anything useful.
Any suggestions would be helpful.
Heres the SQL Server 2000 data table Im using:
[dbo].[CDRL Infromation] (
[cdrlID] [int] IDENTITY (1, 1) NOT NULL ,
[OPFI #] [varchar] (255)
[DID #] [varchar] (50)
[Field Instruction Title] [varchar] (255)
[Gov Lead] [varchar] (255)
[Due] [varchar] (100)
[Next Due Date] [datetime]
[Current Rev Date] [datetime]
[Current Rev] [float]
[SME] [varchar] (255)
[TECH WRITER] [varchar] (255)
[Days to Next Update] [int]
Heres the SELECT and UPDATES for the data source:
SELECT * FROM [CDRL Infromation] WHERE ([cdrlID] = @cdrlID2)
UPDATE [CDRL Infromation] SET [OPFI #] = @column1, [DID #] = @column2, [Field Instruction Title] = @Field_Instruction_Title, [Gov Lead] = @Gov_Lead, [Due] = @Due, [Next Due Date] = @Next_Due_Date, [Current Rev Date] = @Current_Rev_Date, [Current Rev] = @Current_Rev, [SME] = @SME, [TECH WRITER] = @TECH_WRITER, [Days to Next Update] = @Days_to_Next_Update WHERE [cdrlID] = @original_cdrlID
I attempt to edit a record and when I click the Update link on the detailsview I get:
Line 1: Incorrect syntax near nvarchar.
Line 1: Incorrect syntax near ,.
Line 1: Incorrect syntax near ).
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: Line 1: Incorrect syntax near nvarchar.
Line 1: Incorrect syntax near ,.
Line 1: Incorrect syntax near ).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Line 1: Incorrect syntax near nvarchar.
Line 1: Incorrect syntax near ,.
Line 1: Incorrect syntax near ).]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857354
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734966
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +149
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +415
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +401
System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +721
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +78
System.Web.UI.WebControls.DetailsView.HandleUpdate(String commandArg, Boolean causesValidation) +1152
System.Web.UI.WebControls.DetailsView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +461
System.Web.UI.WebControls.DetailsView.OnBubbleEvent(Object source, EventArgs e) +95
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.DetailsViewRow.OnBubbleEvent(Object source, EventArgs e) +109
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +163
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Where the heck is the nvarchar coming from?!? Ive tried looking at the data in the ItemUpdating event but it doesnt really present anything useful.
Any suggestions would be helpful.