Re: ODBC API
From: Roy Fine (rlfine_at_twt.obfuscate.net)
Date: 02/05/04
- Next message: Stephan Rose: "Form Input Focus"
- Previous message: Jeffrey Wynn: "Re: communicating with other app"
- Maybe in reply to: Austin Ehlers: "Re: ODBC API"
- Next in thread: Arrun S: "ODBC API"
- Reply: Arrun S: "ODBC API"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 4 Feb 2004 23:53:00 -0500
Arrun,
SQLDescribeParam is a system API call - you would have to use P/Invoke to
get to that one. That's the short answer.
The long answer is that accessing data using the ODBC API is sufficiently
difficult in C#, and the benefits are so few, you are better off looking for
another solution.
For ADO.Net, if you need schema info on a column returned from a server, use
the GetSchemaTable method on the DataReader object.
The GetSchemaTable method works similar to the ODBC API call, in that the
API call works on the prepared statement - there is a round trip to the
server, but the statement does not have to be executed. Using the data
reader approach requires the behavior parameter to be set to SchemaOnly (or
KeyInfo if you want to execute the select query, and get data and schema
info in one trip)
best regards
roy fine
"Arrun S" <projdqe@yahoo.co.in> wrote in message
news:EB0A9737-619A-4EDB-9155-5BC054E45931@microsoft.com...
> Hi
> I don't know how to access the ODBC API through C#. The VS.NET provides
OLEDB Data Provider but not ODBC.
> E.g., select * from tbl where id=?
> To get the data type (description) of the column 'id', the ODBC provides
a function 'SQLDescribeParam()'. But, I don't know how to access this
function through C#.Could anyone help me?
> TIA,
> Arrun S
>
- Next message: Stephan Rose: "Form Input Focus"
- Previous message: Jeffrey Wynn: "Re: communicating with other app"
- Maybe in reply to: Austin Ehlers: "Re: ODBC API"
- Next in thread: Arrun S: "ODBC API"
- Reply: Arrun S: "ODBC API"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|