By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,671 Members | 1,413 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,671 IT Pros & Developers. It's quick & easy.

Grabbing tables and databases from SQL2000 using C#

P: n/a
I am creating a front end that will access a SQL database and I want
to create a DROP DOWN control that will display the databases and
tables available from a SQL2000 server. Much like the one in the
Import/Export menus in SQL2000 Enterprise Manager.

Does anyone know the class in C# to do that? I can connect fine, I
just want to display the tables and db's.

If I am asking for the wrong thing, by all means, straighten me out
and put me down the proper path. TIA!!

Dizzzzz
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I have done this in the past using the sysobjects and sysdatabases tables.
sysObjects contains information on objects in the current db.
sysDatabases contains info on dbs in the server and is contained in *master*
HTH
JB
"Dizzzz" <di***@dang.com> wrote in message
news:ej********************************@4ax.com...
I am creating a front end that will access a SQL database and I want
to create a DROP DOWN control that will display the databases and
tables available from a SQL2000 server. Much like the one in the
Import/Export menus in SQL2000 Enterprise Manager.

Does anyone know the class in C# to do that? I can connect fine, I
just want to display the tables and db's.

If I am asking for the wrong thing, by all means, straighten me out
and put me down the proper path. TIA!!

Dizzzzz

Nov 13 '05 #2

P: n/a
Just use these stored procedures

sp_databases
sp_tables '%'
sp_columns '%table_name%'

make a command object and execute the query and get the result isn
datareader object or Dataset.

----
Jyoti Prakash Deka
India
"Dizzzz" <di***@dang.com> wrote in message
news:ej********************************@4ax.com...
I am creating a front end that will access a SQL database and I want
to create a DROP DOWN control that will display the databases and
tables available from a SQL2000 server. Much like the one in the
Import/Export menus in SQL2000 Enterprise Manager.

Does anyone know the class in C# to do that? I can connect fine, I
just want to display the tables and db's.

If I am asking for the wrong thing, by all means, straighten me out
and put me down the proper path. TIA!!

Dizzzzz

Nov 13 '05 #3

P: n/a
Hi,

In SQL 2K you have an SP that query those tables: sp_databases, it return
the name of the DB as well as the size of it.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"John Baro" <jo************@SPAMtimbersmart.com.au> wrote in message
news:GG******************@nasal.pacific.net.au...
I have done this in the past using the sysobjects and sysdatabases tables.
sysObjects contains information on objects in the current db.
sysDatabases contains info on dbs in the server and is contained in *master* HTH
JB
"Dizzzz" <di***@dang.com> wrote in message
news:ej********************************@4ax.com...
I am creating a front end that will access a SQL database and I want
to create a DROP DOWN control that will display the databases and
tables available from a SQL2000 server. Much like the one in the
Import/Export menus in SQL2000 Enterprise Manager.

Does anyone know the class in C# to do that? I can connect fine, I
just want to display the tables and db's.

If I am asking for the wrong thing, by all means, straighten me out
and put me down the proper path. TIA!!

Dizzzzz


Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.