M
M
mrss2016-05-16 16:04:57
C++ / C#
mrss, 2016-05-16 16:04:57

Getting database names from MSSQL?

Hello!
There is a database on MSSQL. You need to create a class in C # that receives names, id database and assign it to an array, and then display the array on the Listbox. When the user selects the required database (listBox_SelectedIndexChanged), another form opens and all tables of the selected database are loaded.
Can you tell me how to do it? Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maa-Kut, 2016-05-16
@Maa-Kut

The list of databases can be obtained from sysdatabases:
List of tables - well, let's say from sys.tables:
SELECT [name] FROM sys.tables;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question