Kevin,
You need to supply column's position (ordinal) for GetValue().
sRecVal = oReader.GetValue(intOrdinalOfDesiredColumn)
Cetin
>Ok, here's my code so far:
>
>
>sSQLCommand = "select " & _sSearchField & _
> "from " & _sSearchAlias & _
> "where " & _sSearchField & " like% " & _
> sTextVal
>
>' Create the command object, passing the SQL query string and a reference
>' to the connection object
>oCommand = New OleDbCommand(sSQLCommand, _oConnection)
>
>' Execute the command to get the data
>oReader = oCommand.ExecuteReader()
>
>' Read in the value from the table
>oReader.Read()
>sRecVal = oReader.GetValue()
>
>
>I'm getting the error:
>'Argument not specified for parameter 'ordinal' of 'Public Overridable NotOverridable
>Function GetValue(ordinal As Integer) As Object'.
>
>
>
>
>
>
>
>>I think opening a connection and doing a query every time will be very expensive, and unnecessary.
>>
>>If the table you're querying against isn't very large, you could pull down the results one time....and then execute an ADO.NET rowfilter everytime the user types something.
>>
>>Or, you could have the user type as much info as they want, and then click a search button. You could bring back all the matches (even partial matches), and display them in a listbox or a grid.
>>
>>Just some random thoughts....
>>
>>The textbox in VS.NET 2005 supports AutoComplete - I haven't looked into it in any detail, however.
>>
>>Kevin