Getting Schema Information Through ADO.NET

  • Thread starter Thread starter Martin
  • Start date Start date
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.
 
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
 
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.
 
Back
Top