HighTechTalks DotNet Forums  

tablenames

Dotnet Framework (ADO.net) microsoft.public.dotnet.framework.adonet


Discuss tablenames in the Dotnet Framework (ADO.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Martijn Mulder
 
Posts: n/a

Default tablenames - 11-05-2007 , 02:52 PM






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

Reply With Quote
  #2  
Old   
William Vaughn
 
Posts: n/a

Default Re: tablenames - 11-05-2007 , 07:23 PM







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

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


Reply With Quote
  #3  
Old   
Andrew Faust
 
Posts: n/a

Default Re: tablenames - 11-05-2007 , 09:52 PM



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 (AT) betav (DOT) com> wrote

Quote:
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 (AT) news (DOT) wanadoo.nl...
After I Open(ed) an OleDbConnection, I need the names of the Tables
right away. How? (in C# or in VB)



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.