Connection String Issues

S

Sankalp

Currently I am developing a advanced VB 2005 application which
Display's/ Updates / (Creates New ) data in the database. For this
purpose I am using databound controls, i.e. all my datagrids, textboxes
etc.. are directly linked to the database.

Initially I was using My.Settings.Con ,( where Con being the
connection string in the app.config file) to reference the connection
string used by these table adapters.


Now the problem is that, due to a sudden change is requirement, I need
to add in multiple connection strings ( i.e give users the option to
connect to different databases during application start up ) . Since
all these databases have the same table name and underlying structure I
don't need to change my program ( Logic ) at all.

I need to give the users to ability to select the database at
application startup( First Time , after installation ) and then give
them the ability to change the database during runtime,\ AND after the
user finishes working with the application( i.e Closes the application)
and then returns, the application should automatically point to the
last database the user worked with.


I am using Visual Studio 2005 , .NET 2.0



I am not sure how to do this. Any help in this regard will be
gratefully appreciated.
 
R

rowe_newsgroups

This doesn't seem all that complicated. Presuming you know what the
connection string will be for each db, then all you need to do is match
the Database name to the connection string. If you really wanted to, a
select case could handle this, or am I missing something?

Thanks,

Seth Rowe
 
S

Sankalp

Yes I have the connection strings with me before hand, but how can I
match the database name to the connection string.

Some sort of code would be helpful.


Thankyou
 
R

rowe_newsgroups

Some sort of code would be helpful.

No problem - First off, how would you like the user to select the
database to use? i.e. a combobox, listbox, etc...

Thanks,

Seth Rowe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top