HighTechTalks DotNet Forums  

Accessing a List of Table Names using ODBC.NET

Dotnet Framework (ODBC.net) microsoft.public.dotnet.framework.odbcnet


Discuss Accessing a List of Table Names using ODBC.NET in the Dotnet Framework (ODBC.net) forum.



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

Default Accessing a List of Table Names using ODBC.NET - 07-29-2003 , 09:56 AM






I'm using ODBC.NET to read tables over an InterSystems Cache ODBC
connection. I've been able to access table data, I can return columns
and all properties of the columns from a given table... I just can't
seem to get a list of Tables. Does anyone have any suggestions? Is
there a way to get to it without having to use a Command? I've tried
different CommandText values, but am not sure what to put there.

__________________________________________________ _________________________
DataTable dt = new DataTable();
OdbcCommand cmd = new OdbcCommand();
OdbcDataAdapter da = new OdbcDataAdapter();

string ConnectionString = "Provider=MSDASQL;DSN=DEF;";
OdbcConnection con = new OdbcConnection(ConnectionString);
con.Open();

cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "SELECT * FROM ADJ_REASON_NOTES";

OdbcDataReader rdr = cmd.ExecuteReader(CommandBehavior.SchemaOnly);
dt = rdr.GetSchemaTable();

rdr.Close();
con.Close();
return dt;

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.