473,473 Members | 2,032 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Grabbing tables and databases from SQL2000 using C#

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
3 2670
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Saverio Tedeschi | last post by:
Ho all SQL gurus, I've searched for samples on how to automatically scripting SQL2000 tables to export data between databases via a sql script. (somehing like: INSERT INTO ..(, , , , , )...
4
by: manning_news | last post by:
Using SQL2000. How do I format my select statement to choose one out of 24 different tables? Each table is slightly different and I was hoping I could use one select statement and format it...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
3
by: G rumpy O ld D uffer | last post by:
This is probably a 'Low-Level' question to all the ACCESS experts but I've only been using ACCESS for a couple of weeks. I've been given 30+ (and counting) separate 'Weekly' Databases which all...
4
by: Dirk Olbertz | last post by:
Hi there, I'm currently about to redesign a database which you could compare with a database for managing a library. Now this solution will not only manage one library, but 100 to 500 of them....
5
by: Grzegorz Danowski | last post by:
Hi I have two databases: Customers and Operations. In Customers database I have made a view based on a few tables from both Customers and Operations (left join - customers without any...
3
by: comp_databases_ms-sqlserver | last post by:
This post is related to SQL server 2000 and SQL Server 2005 all editions. Many of my stored procedures create temporary tables in the code. I want to find a way to find the query plan for these...
0
by: basuritta | last post by:
I am trying to add a SQL2000 subscriptor to a SQL2005 publisher and distributor using the Management Studio. I'm using a non-standard port in both ends, but I have set the port for the TCP/IP...
7
by: jc | last post by:
Hello, a question for the MS Access community, from someone who programs with SQL in SQL2000. I currently create a table with varying column names and data within SQL2000. I then need to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.