473,767 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ODBC API

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 'SQLDescribePar am()'. But, I don't know how to access this function through C#.Could anyone help me
TIA
Arrun

Nov 15 '05 #1
7 2854
Hi Arrun,

Have yo checked System.Data.Odb c namespace?
It comes with .net 1.1.

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"Arrun S" <pr*****@yahoo. co.in> wrote in message
news:EB******** *************** ***********@mic rosoft.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 'SQLDescribePar am()'. But, I don't know how to access this
function through C#.Could anyone help me? TIA,
Arrun S

Nov 15 '05 #2
Have you installed the ODBC .NET Data Provider?

http://www.microsoft.com/downloads/d...displaylang=en

Austin

On Tue, 3 Feb 2004 23:36:05 -0800, "Arrun S" <pr*****@yahoo. co.in>
wrote:
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 'SQLDescribePar am()'. But, I don't know how to access this function through C#.Could anyone help me?
TIA,
Arrun S


Nov 15 '05 #3
ODBC is built into the 1.1 version of the Framework. It can be downloaded
and used with version 1.0.
However, this is NOT the ODBC API. As I wrote in my books quite some time
ago, the ODBC API requires "Declare" statements the tie the API entry points
to VB functions and subroutines. There is no publicly available set of
headers for use in .NET languages--not that I've heard of.

What are you trying to do? While you can get at the ODBC drivers, the API
interfaces are tough to get to.

--
_______________ _______________ ______
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
_______________ _______________ ____

"Arrun S" <pr*****@yahoo. co.in> wrote in message
news:EB******** *************** ***********@mic rosoft.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 'SQLDescribePar am()'. But, I don't know how to access this
function through C#.Could anyone help me? TIA,
Arrun S

Nov 15 '05 #4
Arrun,

SQLDescribePara m 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" <pr*****@yahoo. co.in> wrote in message
news:EB******** *************** ***********@mic rosoft.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 'SQLDescribePar am()'. But, I don't know how to access this
function through C#.Could anyone help me? TIA,
Arrun S

Nov 15 '05 #5
This only works if you know what table you want to go after.

What if you need a list of tables, indexes, etc.

Also I need to know what server I'm talking to (Oracle or SQL Server)
because the SQL Syntax is different.

Tony

"Roy Fine" <rl****@twt.obf uscate.net> wrote in message
news:et******** ******@TK2MSFTN GP12.phx.gbl...
Arrun,

SQLDescribePara m 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" <pr*****@yahoo. co.in> wrote in message
news:EB******** *************** ***********@mic rosoft.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 'SQLDescribePar am()'. But, I don't know how to access this
function through C#.Could anyone help me?
TIA,
Arrun S


Nov 16 '05 #6
This only works if you know what table you want to go after.

What if you need a list of tables, indexes, etc.

Also I need to know what server I'm talking to (Oracle or SQL Server)
because the SQL Syntax is different.

Tony

"Roy Fine" <rl****@twt.obf uscate.net> wrote in message
news:et******** ******@TK2MSFTN GP12.phx.gbl...
Arrun,

SQLDescribePara m 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" <pr*****@yahoo. co.in> wrote in message
news:EB******** *************** ***********@mic rosoft.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 'SQLDescribePar am()'. But, I don't know how to access this
function through C#.Could anyone help me?
TIA,
Arrun S


Nov 16 '05 #7
This only works if you know what table you want to go after.

What if you need a list of tables, indexes, etc.

Also I need to know what server I'm talking to (Oracle or SQL Server)
because the SQL Syntax is different.

Tony

"Roy Fine" <rl****@twt.obf uscate.net> wrote in message
news:et******** ******@TK2MSFTN GP12.phx.gbl...
Arrun,

SQLDescribePara m 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" <pr*****@yahoo. co.in> wrote in message
news:EB******** *************** ***********@mic rosoft.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 'SQLDescribePar am()'. But, I don't know how to access this
function through C#.Could anyone help me?
TIA,
Arrun S


Nov 16 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2245
by: Marco Aschwanden | last post by:
Hi - Win2000 - Python 2.3.3 - py2exe 0.5.0 - eGenix Comercial & Base Package I am developing an app using mxODBC. On the home page they say http://www.egenix.com/files/python/mxODBC.html#Hints
11
3764
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows 2003 Server or ADO or ODBC issue, I am posting this on all of the three newsgroups. That's the setup: Windows 2003 Server with IIS and ASP.NET actiavted Access 2002 mdb file (and yes, proper rights are set on TMP paths and path,
0
1386
by: Kong Li | last post by:
Follow up to this thread, the latest Oracle 9i release 2 patchset (9.2.0.5) fixed the handle count leak problem. The problem is in Oracle client component. Thanks. Kong ----- From: Kong Li (likong@email.com)
6
6784
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used the SQL Profile to watch the T-SQL-Command which Access ( who creates the commands?) creates and noticed:
4
7251
by: Roger Redford | last post by:
Dear Experts, I'm attempting to marry a system to an Oracle 817 datbase. Oracle is my specialty, the back end mainly, so I don't know much about java or javascript. The system uses javascript to make ODBC calls to the db. The particular system I'm working with, will not work with an Oracle stored procedure I'm told. However, it
4
5650
by: Andreas Lauffer | last post by:
Can anyone tell me advantages / disadvantages of DataDirect Server Wire ODBC-driver? Any experiences? What about redistribution? Andreas Lauffer, easySoft. GmbH, Germany
3
6187
by: Lauren Quantrell | last post by:
Maybe a dumb question - I'm new to ODBC. How do I install an Access ..mde file on a user's workstation and create the ODBC connection to the backend SQL Server database without having to go through the Administrative Tools>Data SOurces (ODBC) menu? IS there a way to do this with VBA code from my installer disk, or by simply copying a file onto the user's PC? Any help is appreciated. LQ
5
40407
by: Alec | last post by:
Hi All, I am currently trying to link in Access 97 to a table in a MSSQL 7 server. Initially the link is fine, however, when I close the access database and re-open it from the same network lacation on a different machine, it tells me that the ODBC connection to 'SQL Server Name' failed. How can I create the linked table permenant no matter what machine the networked database is opened on?
2
9950
by: Crazy Cat | last post by:
Hi all, I am having trouble getting linked Oracle 9 server in MS SQL Server 2005 Express to work properly. My machine is running Windows XP. The Microsoft and Oracle OLE DB Providers have problems dealing with Oracle's Numeric Data Type, so I decided to use Microsoft's OLE DB for ODBC Provider and an Oracle ODBC source. When using the Microsoft ODBC for Oracle Driver in my ODBC source I have inconsistent behavior. Sometimes my queries...
0
12067
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in '/CinemaBookingSystem' Application. -------------------------------------------------------------------------------- ERROR General error Unable to open registry key 'Temporary (volatile) Jet DSN for process
0
9571
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10009
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.