Home » questions » What does this error mean and how to correct it?

What does this error mean and how to correct it?

2006-07-31 21:17:22, Category: Programming & Design
An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.data.dll Additional information: An OleDbParameter with ParameterName 'ISBN' is not contained by this OleDbParameterCollection. The code: If cboSearch.Text = "Books" Then Dim ProductId As String txtProductID.Text = ProductId Dim dt As New DataTable OleDbDataAdapter1.SelectCommand.Parameters("ISBN").Value = txtProductID.Text OleDbDataAdapter1.Fill(dt) DataGrid1.DataSource = dt End If OleDbDataAdapter1.SelectCommand.Parameters("ISBN").Value = txtProductID.Text is highlighted in green am using vb.net and access how do u set the parameters with oledbdataadapter

Answers

  1. GrapeApe33

    On 2006-07-31 21:22:11


    Its time for the geek squad....
  2. publicguest

    On 2006-08-01 03:20:41


    Index out of range exception comes when your trying to access some null index. example ----------- now name is the array variable. you can able to verify that array using name[1].........................name[10] the array size is 10 now you can able to access upto 10 index now you try to access name[11].----------------this statement gives error index out of range exception.
  3. dreamcatweaver

    On 2006-07-31 21:35:02


    Is ISBN one of the index keys? When it says something is out of range it usually means it's not within your search parameters (in other words, it can't find what you want to search on).