Getting Schema Information Through ADO.NET

M

Martin

Hi

Is there any way of getting database schema information through
ADO.NET or .NET in a way which is database vendor independent?

I want to connect to Oracle, SQL Server and other data sources and ask
what columns a table has, what datatypes are used, what FKs and PKs
there are on the table etc. I don't want to worry about what type of
database I am connected to.

I don't mind if I use vendor-specific providers, or the generic ODBC
or OLEDB providers, or if I skip over ADO.NET entirely and use ADO,
DAO, ODBC or OLEDB. I don't want to use catalog views because these
are database vendor dependant.

Many thanks

Martin.
 
U

Uwe Hafner

Hi,

Martin said:
Hi

Is there any way of getting database schema information through
ADO.NET or .NET in a way which is database vendor independent?

I want to connect to Oracle, SQL Server and other data sources and ask
what columns a table has, what datatypes are used, what FKs and PKs
there are on the table etc. I don't want to worry about what type of
database I am connected to.

I don't mind if I use vendor-specific providers, or the generic ODBC
or OLEDB providers, or if I skip over ADO.NET entirely and use ADO,
DAO, ODBC or OLEDB. I don't want to use catalog views because these
are database vendor dependant.

I have never worked with it but
OleDbConnection

has a method called
GetOleDbSchemaTable

might be what you are looking for.

hth
Uwe
 
M

Martin

Uwe Hafner said:
Hi,



I have never worked with it but
OleDbConnection

has a method called
GetOleDbSchemaTable

might be what you are looking for.

hth
Uwe


Thanks, this looks very promising. The results returned by Oracle and
SQL-Server are virtually the same.

Martin.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top