tablenames

M

Martijn Mulder

After I Open(ed) an OleDbConnection, I need the names of the Tables
right away. How? (in C# or in VB)
 
W

William Vaughn

Some providers implement the GetSchema method of the Connection object.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
A

Andrew Faust

GetSchema works well for the major databases I've used, Oracle, SQL Server,
MySQL, PostgreSQL as well as CSV & Excel. However, you may have to deal
with some of the pecularities of the implementation of each of them. They
should all return the table names similarly, however, some will return all
the system tables. Some will return only the tables accessible to the user.
There are some other peculiarities that show up such as whether null or the
empy string is returned for blank columns.

Still, it's the best method I've found.
 

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