SQLDataReader GetTableSchema not retruning Key info.

  • Thread starter Thread starter Tim Marsden
  • Start date Start date
T

Tim Marsden

I am using the DataReader.GetTableSchema method to obtain table schema.
However the IsKey column is Null, how do I obtain key info.

I really would like a independent way of returning schema, using
ODBCDataReader, OleDBDataReader, SQLDataReader and the OracleDataReader. I
want the user to choose as run time how they want to connect to their
databases.

Tim
 
Rajesh

Many thanks for the information.

Do you happen to know how to retrieve a list of tables or views from a
database using all .net providers (Data.OleDB, Data.SQLClient, Data.ODBC and
Data.Oracle)

Hope you can help

Ragards Tim
 
For ODBC and Oracle it would depend upon the backend datasources Schema query, however the following link provides a bit of insight into this.. This is specifically the SQL and
OLEDB ways of getting teh tables and views, modifications would need to be made for Oracle or other databases depending on their structures. the oracle provider does not
have this capability.

Obtaining Schema Information from a Database (SQL And OLEDB)
http://msdn.microsoft.com/library/d...conobtainingschemainformationfromdatabase.asp


Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.




--------------------
 
Back
Top