Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

vb.net

Hello every one,

I am unable to retrive data from a data set based on the value in a textbox into a data grid.
I am getting the error Object reference not set to an instance of an object.

The code is as follows in vb.net:
Dim search As String = Txtsearchname.Text
OleDbDataAdapter2.SelectCommand.Parameters("Name").Value = search//error
DataSet21.Clear()
OleDbDataAdapter2.Fill(DataSet21)

i am entering a name in the textbox TxtsearchName, based on the name entered in the text box the data grid should display all the details of that particular person.

I passed the name as parameter.
[644 byte] By [gaddam_Sarika] at [2007-11-11 7:46:05]
# 1 Re: vb.net
How are you creating the SelectCommand for your DataAdapter? Please post your code.
Phil Weber at 2007-11-11 21:48:39 >