Click here to Skip to main content
15,898,036 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
how can show all database in combo list of sql server?

how can connect with database of sql server manual as i use a user name and pass word of user that is a shop and there is two database so first i am checking user-name and password and then connection database for working
Posted
Updated 24-Jan-12 23:20pm
v2

Your question is really bvery unclear so not sure if this will help. However, putting my babelfish in I think you mean how do I get a list of all sql server instances and log on to one just like the sql server logon dialog?

Well, look no more; it's all in here: GNR8 - Simple C# Class Generator[^]. Ignore the subject: there is a dialog and code in there to do what I think you need. If not, then feel free to ignore.
 
Share this answer
 
Hi,

You can use master table for listout all databases in your SQL server.

SQL
select name from master.sys.databases


is this what you want ?

hope it will help you,

thanks
-Amit.
 
Share this answer
 
select *from master.sys.databases
 
Share this answer
 
v2
SELECT name FROM sys.databases
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900