I'm working in VS2003.NET, with C#.
I use app.config to store the connection string to my SQL Server. This
works fine.
Lately I've been taking work home where the connection string is
different. I deal with this by having app.config.home and
app.config.work files which I copy over the app.config file as required
by my location.
I was wondering if there is another way to do this. In my Microsoft.NET
file system hierarchy I notice a CONFIG directory with a machine.config
file in it. Said machine.config file has an example appSettings section
in it.
Would that be an appropriate place to store my SQL Server connection
string? How would I access it? I currently say
'ConfigurationS ettings.AppSett ings["strCon"]'. How would that change?
Thank you,
-- Rick
I use app.config to store the connection string to my SQL Server. This
works fine.
Lately I've been taking work home where the connection string is
different. I deal with this by having app.config.home and
app.config.work files which I copy over the app.config file as required
by my location.
I was wondering if there is another way to do this. In my Microsoft.NET
file system hierarchy I notice a CONFIG directory with a machine.config
file in it. Said machine.config file has an example appSettings section
in it.
Would that be an appropriate place to store my SQL Server connection
string? How would I access it? I currently say
'ConfigurationS ettings.AppSett ings["strCon"]'. How would that change?
Thank you,
-- Rick
Comment