English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

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

2006-07-31 17:17:22 · 3 answers · asked by braich_gal 3 in Computers & Internet Programming & Design

how do u set the parameters with oledbdataadapter

2006-07-31 17:36:28 · update #1

3 answers

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.

2006-07-31 23:20:41 · answer #1 · answered by publicguest 2 · 2 2

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).

2006-07-31 17:35:02 · answer #2 · answered by dreamcatweaver 4 · 0 0

Its time for the geek squad....

2006-07-31 17:22:11 · answer #3 · answered by 345Grasshopper 5 · 0 0

fedest.com, questions and answers