Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connecting to an Access Table
Message
From
20/10/2005 07:37:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01059787
Message ID:
01060638
Views:
15
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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform