Using OleDb's GetOleDbSchemaTable to read meta data

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

We're using the .NET OleDb classes to read meta data out of SQL
Server, SQL has all of the proper SQL 92 Information Schema Views
however the API in .NET doesn't return View information, it does for
Tables and Stored procs?

====================================== ==============
OleDbConnection cn = new OleDbConnection("my connection");
cn.Open();
DataTable schemaTable=cn.GetOleDbSchemaTable(OleDbSchemaGuid.Views,
null);
====================================

I get the error: The Views OleDbSchemaGuid is not a supported schema
by the 'SQLOLEDB' provider.

Oracle supports it fully, SQL Server has all of the views I wonder why
they didn't support this?
 
On 12 Sep 2003 12:16:19 -0700, (e-mail address removed) (Mike) wrote:

¤ We're using the .NET OleDb classes to read meta data out of SQL
¤ Server, SQL has all of the proper SQL 92 Information Schema Views
¤ however the API in .NET doesn't return View information, it does for
¤ Tables and Stored procs?
¤
¤ ====================================== ==============
¤ OleDbConnection cn = new OleDbConnection("my connection");
¤ cn.Open();
¤ DataTable schemaTable=cn.GetOleDbSchemaTable(OleDbSchemaGuid.Views,
¤ null);
¤ ====================================
¤
¤ I get the error: The Views OleDbSchemaGuid is not a supported schema
¤ by the 'SQLOLEDB' provider.
¤
¤ Oracle supports it fully, SQL Server has all of the views I wonder why
¤ they didn't support this?

I think SQL Server includes Views with Tables. See if the following works:

DataTable schemaTable=cn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,
new Object[] {null, null, null, "VIEW"});


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top