Click here to Skip to main content
15,900,665 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

I want to be able to select between multiple databases
Each database will basically have the same info for the most part.
all the tables and views will be the same...they will just hold
different statistics but with the same structure...as far as tables and views....
all tables and views are Identical

Presently I have a database that is built..and I am using vb.net and Mssql 2008
So I know I can add all the different databases to the project.
and then drag database out on the form and wahlah it produces what i have asked for....
But this would require way to much space and would always be connected to everything?
which i am sure would not be the right way....

But I need to be able to choose between databases and once i select one..
It will connect and load to the datagrids that I have on the forms..


I thought i could use like tree view or a combobox to make the selection .
and then all the datagrids would be connected to the database chosen .


Does any one have any possible solutions to this type scenario

Thanks in Advance...
Jeff

p.s I would provide code But not really for sure how to start.
I am weak on the subject
Posted

1 solution

I'd use a ComboBox (or similar), you can populate the Items with Tuples of strings -- a name and a connection string. Select a database by name, connect, query, disconnect. I have a few small apps like that.
 
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