Results 1 to 4 of 4

Thread: [RESOLVED] dataset fill ... parameter error????

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    7

    Resolved [RESOLVED] dataset fill ... parameter error????

    If ever anyone needed help ...
    I got following message when attempting to fill a dataset.

    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:


    Line 207: Me.DSmdl1.Clear()
    Line 208:
    Line 209: Me.OleDbDataAdapter2.Fill(DSmdl1.tblCarMdl)
    Line 210:
    Line 211: cmbBox2.DataBind()


    Source File: f:\inetpub\wwwroot\Web2\WebForm1.aspx.vb Line: 209

    Stack Trace:


    [OleDbException (0x80040e10): No value given for one or more required parameters.]
    System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
    System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
    System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
    System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
    System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
    System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
    System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
    System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
    System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand command, CommandBehavior behavior)
    System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
    Web2.WebForm1.cmbBox_SelectedIndexChanged(Object sender, EventArgs e) in f:\inetpub\wwwroot\Web2\WebForm1.aspx.vb:209
    System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e)
    System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent( )
    System.Web.UI.Page.RaiseChangedEvents()
    System.Web.UI.Page.ProcessRequestMain()




    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

  2. #2
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: dataset fill ... parameter error????

    Sounds pretty self-explanitory. Show some code.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    7

    Re: dataset fill ... parameter error????

    WILD BILL,

    Thanks for speedy reply.
    The procedure that contains the offensive code is as follows:

    ------------------------------------------------------------------------
    Private Sub cmbBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) _
    Handles cmbBox.SelectedIndexChanged

    Dim sqlx As String

    Dim xxx As String


    OleDbConnection1.Open()

    xxx = cmbBox.SelectedValue

    sqlx = "select field1 from table1 where table1.field2= " & xxx & " "


    Me.OleDbDataAdapter2.SelectCommand.CommandText = sqlx

    Me.DSmdl1.Clear()
    Me.OleDbDataAdapter2.Fill(DSmdl1, "table1l")

    cmbBox2.DataBind()

    End Sub

    I am trying to change the command text to sqlx

    Thanks again.

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    7

    Re: dataset fill ... parameter error????

    It seems my proc did not provide try/catch and there was an error in my sql statement thereby causing an exception.

    Included try/catch and corrected sql and works fine now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width