Reputation: 435
Basically I want to know if it is possible to connect my VB app with SQL server on the same Computer (Local) and interrogate it for a list of database names.
I just want to know if that is possible.
sqlConn.ConnectionString = Data Source=local;Initial Catalog=unknownDatabase;User Id=knownUsername;Password=knownPassword;"
Fill DataBase Names to Drop Down
User Selects DB Name
Change Connection to now Known DatabaseName
Upvotes: 0
Views: 781
Reputation: 10452
Of course it is possible.. You can create a connection to a local SQL instance the same way you'd create a connection to a remote one.
Then to get a list of the databases on the server, execute "SELECT Name FROM master.sys.databases"
Upvotes: 2