Using OleDb's GetOleDbSchemaTable to read meta data

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?
 
P

Paul Clement

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)
 

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