getSchema only returns dtProperties

D

DavidGB

No matter what I do, I cannot persuade getSchema to return any table name
other than dtProperties.
Code is:
Dim connex As SqlConnection = Utilities.getConnection()

Dim restrictions() As String = {DatabaseName, "dbo", Nothing,
"BASE TABLE"}
Dim dTable As DataTable = connex.GetSchema("Tables", restrictions)

Return dTable

Any ideas?
 
D

DavidGB

Don't worry, I fixed it.

FYI - only getting dtproperties indicates an authentication problem!

David
 
D

DavidGB

This is getting VERY embarrassing. I haven't fixed it.
All I've done is to prove to myself that I'm a lousy tester, and I should
sack myself!

So I still have this problem - only dtProperties shows up. What is going on?
 
W

William Vaughn \(MVP\)

I have an example that's included in my book that shows how to capture the valid metadata enumerators from GetSchema (basically, what it can fetch for you based on the functionality exposed by the provider) and drill into those collections. The result is shown below. It looks like you need to ask for "tables", not "base tables". Yes, it looks like the Table_Type is "Base Table", but that's not the collection name.

hth



--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
 
F

Frans Bouma [C# MVP]

DavidGB said:
This is getting VERY embarrassing. I haven't fixed it.
All I've done is to prove to myself that I'm a lousy tester, and I should
sack myself!

So I still have this problem - only dtProperties shows up. What is going on?

GetSchema works on the catalog you are currently connecteed to. So if
you specified in the connection string "initial catalog=Northwind", you
get the tables of the Northwind table. That is, if you have access
rights to these tables. So:
- be sure the user you're connecting with has the proper access rights
to the tables you want to retrieve the meta-data for
- be sure you can access the RDBMS service and the catalog/schema you
want to connect to and specify the catalog / schema in the connection
string.

FB


--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 

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