Andrew
Mon Nov 05 18:52:48 PST 2007
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.
--
Andrew Faust
andrew[at]andrewfaust.com
http://www.andrewfaust.com
"William Vaughn" <billvaNoSPAM@betav.com> wrote in message
news:ePBrStAIIHA.484@TK2MSFTNGP06.phx.gbl...
>
> 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)
> -----------------------------------------------------------------------------------------------------------------------
>
> "Martijn Mulder" <i@m> wrote in message
> news:472f748c$0$74233$dbd43001@news.wanadoo.nl...
>> After I Open(ed) an OleDbConnection, I need the names of the Tables
>> right away. How? (in C# or in VB)
>