Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid View : No value given for one or more required parameters.

Status
Not open for further replies.

jasonhuibers

Programmer
Sep 12, 2005
290
CA
I am experimenting with Visual Studio 2015. I created a webform in which contains a datagrid. I have enabled Edit and Delete on the grid. When I select PREVIEW IN BROWSER option, the page loads with the datagrid returning the correct data. I have two links in the grid Edit and Delete. I select Edit and on the grid one of the columns is editable... I change the data in one of the columns and when I click on the Update link I receive the following error. Not sure why I am receiving this error... This is all code generated from Visual Studio when selecting the options for the Data grid.

No value given for one or more required parameters.

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: No value given for one or more required parameters.

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:


[OleDbException (0x80040e10): No value given for one or more required parameters.]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) +1130764
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +247
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +208
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +58
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +162
System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +107
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +392
System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +670
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +106
System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +1210
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +877
System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +89
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +90
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +121
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +161
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9721782
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.81.0
 
UpdateCommand="UPDATE [Table1] SET [SEQ_NUM] = ?, [RECORD_IND] = ?, [UFC_ID] = ?, [Parameter_Value] = ?, [Start_Date] = ? WHERE (([Parameter_Name] = ?) OR ([Parameter_Name] IS NULL AND ? IS NULL)) AND (([SEQ_NUM] = ?) OR ([SEQ_NUM] IS NULL AND ? IS NULL)) AND (([RECORD_IND] = ?) OR ([RECORD_IND] IS NULL AND ? IS NULL)) AND (([UFC_ID] = ?) OR ([UFC_ID] IS NULL AND ? IS NULL)) AND (([Parameter_Value] = ?) OR ([Parameter_Value] IS NULL AND ? IS NULL)) AND (([Start_Date] = ?) OR ([Start_Date] IS NULL AND ? IS NULL))">
 
are you using one of those datasource controls?
If you are, I suggest you don't. Debugging errors while using them is very difficult.

I would imagine that you are missing a parameter to the query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top