Hi,
I'm filling a GridView with a simple sproc select statement. I'm
trying to use the Update tab to create an update statement and using
the following:
Update Shipping_Reques ts
Set Shipped = @Shipped
The Shipped column is a bit type column that is returned in the
initial sproc call to fill the GridView. I'm getting the error:
"Incorrect syntax near 'nvarchar'" when trying to update the row.
The stack trace is below. This seems like a no brainer but I can't
seem to get it to work. Any ideas? Thanks in advance.
[SqlException (0x80131904): Incorrect syntax near 'nvarchar'.]
System.Data.Sql Client.SqlConne ction.OnError(S qlException exception,
Boolean breakConnection ) +859322
System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection ) +736198
System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
stateObj) +188
System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleR esultSet bulkCopyHandler , TdsParserStateO bject
stateObj) +1959
System.Data.Sql Client.SqlComma nd.FinishExecut eReader(SqlData Reader
ds, RunBehavior runBehavior, String resetOptionsStr ing) +149
System.Data.Sql Client.SqlComma nd.RunExecuteRe aderTds(Command Behavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean
async) +903
System.Data.Sql Client.SqlComma nd.RunExecuteRe ader(CommandBeh avior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method, DbAsyncResult result) +132
System.Data.Sql Client.SqlComma nd.InternalExec uteNonQuery(DbA syncResult
result, String methodName, Boolean sendToPipe) +415
System.Data.Sql Client.SqlComma nd.ExecuteNonQu ery() +135
System.Web.UI.W ebControls.SqlD ataSourceView.E xecuteDbCommand (DbCommand
command, DataSourceOpera tion operation) +401
System.Web.UI.W ebControls.SqlD ataSourceView.E xecuteUpdate(ID ictionary
keys, IDictionary values, IDictionary oldValues) +721
System.Web.UI.D ataSourceView.U pdate(IDictiona ry keys, IDictionary
values, IDictionary oldValues, DataSourceViewO perationCallbac k
callback) +78
System.Web.UI.W ebControls.Grid View.HandleUpda te(GridViewRow row,
Int32 rowIndex, Boolean causesValidatio n) +1215
System.Web.UI.W ebControls.Grid View.HandleEven t(EventArgs e, Boolean
causesValidatio n, String validationGroup ) +858
System.Web.UI.W ebControls.Grid View.OnBubbleEv ent(Object source,
EventArgs e) +95
System.Web.UI.C ontrol.RaiseBub bleEvent(Object source, EventArgs
args) +35
System.Web.UI.W ebControls.Grid ViewRow.OnBubbl eEvent(Object source,
EventArgs e) +117
System.Web.UI.C ontrol.RaiseBub bleEvent(Object source, EventArgs
args) +35
System.Web.UI.W ebControls.Link Button.OnComman d(CommandEventA rgs e)
+115
System.Web.UI.W ebControls.Link Button.RaisePos tBackEvent(Stri ng
eventArgument) +163
System.Web.UI.W ebControls.Link Button.System.W eb.UI.IPostBack EventHandler.Ra isePostBackEven t(String
eventArgument) +7
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +11
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData)
+174
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)
+5102
I'm filling a GridView with a simple sproc select statement. I'm
trying to use the Update tab to create an update statement and using
the following:
Update Shipping_Reques ts
Set Shipped = @Shipped
The Shipped column is a bit type column that is returned in the
initial sproc call to fill the GridView. I'm getting the error:
"Incorrect syntax near 'nvarchar'" when trying to update the row.
The stack trace is below. This seems like a no brainer but I can't
seem to get it to work. Any ideas? Thanks in advance.
[SqlException (0x80131904): Incorrect syntax near 'nvarchar'.]
System.Data.Sql Client.SqlConne ction.OnError(S qlException exception,
Boolean breakConnection ) +859322
System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection ) +736198
System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
stateObj) +188
System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleR esultSet bulkCopyHandler , TdsParserStateO bject
stateObj) +1959
System.Data.Sql Client.SqlComma nd.FinishExecut eReader(SqlData Reader
ds, RunBehavior runBehavior, String resetOptionsStr ing) +149
System.Data.Sql Client.SqlComma nd.RunExecuteRe aderTds(Command Behavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean
async) +903
System.Data.Sql Client.SqlComma nd.RunExecuteRe ader(CommandBeh avior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method, DbAsyncResult result) +132
System.Data.Sql Client.SqlComma nd.InternalExec uteNonQuery(DbA syncResult
result, String methodName, Boolean sendToPipe) +415
System.Data.Sql Client.SqlComma nd.ExecuteNonQu ery() +135
System.Web.UI.W ebControls.SqlD ataSourceView.E xecuteDbCommand (DbCommand
command, DataSourceOpera tion operation) +401
System.Web.UI.W ebControls.SqlD ataSourceView.E xecuteUpdate(ID ictionary
keys, IDictionary values, IDictionary oldValues) +721
System.Web.UI.D ataSourceView.U pdate(IDictiona ry keys, IDictionary
values, IDictionary oldValues, DataSourceViewO perationCallbac k
callback) +78
System.Web.UI.W ebControls.Grid View.HandleUpda te(GridViewRow row,
Int32 rowIndex, Boolean causesValidatio n) +1215
System.Web.UI.W ebControls.Grid View.HandleEven t(EventArgs e, Boolean
causesValidatio n, String validationGroup ) +858
System.Web.UI.W ebControls.Grid View.OnBubbleEv ent(Object source,
EventArgs e) +95
System.Web.UI.C ontrol.RaiseBub bleEvent(Object source, EventArgs
args) +35
System.Web.UI.W ebControls.Grid ViewRow.OnBubbl eEvent(Object source,
EventArgs e) +117
System.Web.UI.C ontrol.RaiseBub bleEvent(Object source, EventArgs
args) +35
System.Web.UI.W ebControls.Link Button.OnComman d(CommandEventA rgs e)
+115
System.Web.UI.W ebControls.Link Button.RaisePos tBackEvent(Stri ng
eventArgument) +163
System.Web.UI.W ebControls.Link Button.System.W eb.UI.IPostBack EventHandler.Ra isePostBackEven t(String
eventArgument) +7
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +11
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData)
+174
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)
+5102
Comment