M
M
mrss2016-05-16 00:00:48
Database
mrss, 2016-05-16 00:00:48

How to list a database?

hello !
Please tell me how to display a list of all databases existing on SQL Server, for example, on a listbox, so that users can select the database they need? Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2016-05-16
@Nipheris

SqlConnection.GetSchema with the "Databases" parameter will return you a DataTable with a list of databases. Link it to a listbox or fill in the listbox manually..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question