473,473 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Connection String Issues

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.

Jan 17 '07 #1
3 1472
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
Sankalp wrote:
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.
Jan 18 '07 #2
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
rowe_newsgroups wrote:
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
Sankalp wrote:
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.
Jan 18 '07 #3
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
Sankalp wrote:
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
rowe_newsgroups wrote:
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
Sankalp wrote:
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.
Jan 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cliff Cooley | last post by:
Can anybody suggest what may be causing the following problem ? I have an ASP script that opens a connection to an Oracle database using a DSN connection string, such as : Set dbConn=...
4
by: Mark | last post by:
OK. Here we go. I have an ASP.NET application that does many hits to a SQL Server DB on a separate server. When I first created this application (2 years ago) and was very new to ASP/ASP.NET, to...
2
by: Lior | last post by:
Hi, I have an ASP.NET website that crashes under heavy load. I use a SQL Server DB. I get around 5500 hits per day. I keep getting the timeout expieried connection pool error. Sometimes it even...
1
by: Lenny Shprekher | last post by:
Hi, I am getting issues that Oracle collecting opened sessions (connections) from my webservice using regular System.Data.OleDb.OleDbConnection object. I am guessing that this is connection...
2
by: gary g. | last post by:
I was wondering if it was possible to store a connection string only once in a single config file, and let it be accessible to every project in the solution (web included). This way if the...
9
by: nbs.tag | last post by:
hey guys heres my question. I was told by a little birdie that .net 2.0 has the ability to read a connection string directly from a registry key. so in the registry key a string value of say :...
2
by: Simon | last post by:
I have problems with connection strings. I have added new connection string to Web.config: <connectionStrings> <add name="ConnStr" connectionString="xxxxxxxxxxxxxxx"/> </connectionStrings> ...
3
by: dbuchanan | last post by:
Here is part of the web.config - it is given to me like this. ======================= <configuration> <appSettings/> <connectionStrings> <add name="MyConnectionName" connectionString="Data...
8
by: Brett | last post by:
I wrote an ASP.NET application that queries a SQL Server database (on a different box from the web server) and displays the result in a GridView. The datasource for the GridView is a SQLDataSource....
6
by: cj2 | last post by:
If from withing one program I want to access multiple databases on a sql server do I need to make multiple connections? The connection string says initial catalog. I'd assume I could denote the...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.