Re: ODBC API

From: Roy Fine (rlfine_at_twt.obfuscate.net)
Date: 02/05/04


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
>



Relevant Pages

  • Re: ODBC API
    ... SQLDescribeParam is a system API call - you would have to use P/Invoke to ... The long answer is that accessing data using the ODBC API is sufficiently ... For ADO.Net, if you need schema info on a column returned from a server, use ... KeyInfo if you want to execute the select query, ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: ODBC over MASM
    ... Currently I am looking at the ODBC API and the binding ... My database needs are to Jet and SQL Server. ... own database engine parse ka-bob). ...
    (microsoft.public.data.odbc)
  • ODBC over MASM
    ... Currently I am looking at the ODBC API and the binding ... My database needs are to Jet and SQL Server. ... own database engine parse ka-bob). ...
    (microsoft.public.data.odbc)
  • Re: ODBC API
    ... Also I need to know what server I'm talking to ... > The long answer is that accessing data using the ODBC API is sufficiently ... > For ADO.Net, if you need schema info on a column returned from a server, ... > KeyInfo if you want to execute the select query, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ODBC API
    ... Also I need to know what server I'm talking to ... > The long answer is that accessing data using the ODBC API is sufficiently ... > For ADO.Net, if you need schema info on a column returned from a server, ... > KeyInfo if you want to execute the select query, ...
    (microsoft.public.dotnet.framework)