471,627 Members | 1,163 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,627 software developers and data experts.

Connection String Opinion?

I'm having a design brain-cramp.

I have an app that needs to have a connection string that can changed by the
user.... (basically the same app needs to be able to talk to different
databases on different servers --- they all have -identical- tables/views/sp
within them)

So, it seems like I would want to make a "database"form and have a
connection string as a property... But as I do this, I feel I'm swimming
upstream all the time so to speak --- everything seems to want to use a
connectiong string from app.config.

Do you have any ideas on how I should handle this? It seems like I can't
use the design time UI much if I keep going the way I'm going (like for grid
design and such)...

TIA!

Dec 16 '05 #1
2 1147
I use the app.config for all my projects. This works out well for
development. If I change my test database I can just edit the app.config
and everything works with the new path.

That being said I don't use the app.config for my application in the field.
First time I tried to explain editing the app.config to a customer I relized
it was way not acceptable.

So my solution is to store all the database path parts in the reg and allow
the user to edit them from a data source form. I then place a function in
all my forms initialize function that calls the database string builder.

"Brett Wickard" <br**********@nospam.nospam> wrote in message
news:O2*************@TK2MSFTNGP12.phx.gbl...
I'm having a design brain-cramp.

I have an app that needs to have a connection string that can changed by
the user.... (basically the same app needs to be able to talk to different
databases on different servers --- they all have -identical-
tables/views/sp within them)

So, it seems like I would want to make a "database"form and have a
connection string as a property... But as I do this, I feel I'm swimming
upstream all the time so to speak --- everything seems to want to use a
connectiong string from app.config.

Do you have any ideas on how I should handle this? It seems like I can't
use the design time UI much if I keep going the way I'm going (like for
grid design and such)...

TIA!

Dec 16 '05 #2
Sorry, last one few away before finishing.

I use the app.config for all my projects. This works out well for
development. If I change my test database I can just edit the app.config
and everything works with the new path.

That being said I don't use the app.config for my application in the field.
First time I tried to explain editing the app.config to a customer I
realized
it was way not acceptable.

So my solution is to store all the database path parts in the reg and allow
the user to edit them from a data source form. I then place a function in
all my forms initialize function that calls the database string builder.

....ConnectionString = MyClass.GetConnetionString();

..NET 2 has the option to store the data in a application file but each time
you change your application version then user has to reset the database
path. They also have better ways of reading / writing the data for what its
worth.

Regards,
John

"Brett Wickard" <br**********@nospam.nospam> wrote in message
news:O2*************@TK2MSFTNGP12.phx.gbl...
I'm having a design brain-cramp.

I have an app that needs to have a connection string that can changed by
the user.... (basically the same app needs to be able to talk to different
databases on different servers --- they all have -identical-
tables/views/sp within them)

So, it seems like I would want to make a "database"form and have a
connection string as a property... But as I do this, I feel I'm swimming
upstream all the time so to speak --- everything seems to want to use a
connectiong string from app.config.

Do you have any ideas on how I should handle this? It seems like I can't
use the design time UI much if I keep going the way I'm going (like for
grid design and such)...

TIA!

Dec 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Tyson Marchuk | last post: by
4 posts views Thread by A.M | last post: by
5 posts views Thread by Fernando Lopes | last post: by
37 posts views Thread by sam44 | last post: by
14 posts views Thread by martin1 | last post: by
9 posts views Thread by =?Utf-8?B?Vmlua2k=?= | last post: by
reply views Thread by leo001 | last post: by

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.