Settings.settings in .NET 2005

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I've just upgraded from .NET 2003 to 2005.
I was using an app.config file to set my connections.

I see that this must have automatically been changed when .NET converted my
solution from 2003 to 2005.

Do I use both the app.config file and the settings.settings file?
I see that code has been added to the top of my app.config file, a
<connectionStrings> section, in addition to my <apps setting> section that I
previously used.

I'm working on a laptop, with SQL Server Express, when I release my
solution, I use a different app.config key that specifies a connection on a
network elsewhere.

How do I deal with this using my.settings.settings?

I'm a bit confused.....

TIA.
Amber
 
Go with your app.config file and add your connection strings in the
connectionStrings section. There's more info and links to other topics
in
http://msdn2.microsoft.com/en-us/library/ms254494(en-US,VS.80).aspx. A
different solution might be to use the SqlConnectionStringBuilder to
avoid exposing connection strings entirely. See
http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder.aspx
and http://msdn2.microsoft.com/en-us/library/ms254947.aspx for more
info. You can also now edit configuration files at runtime using the
new classes in System.Configuration as well as encrypt them using
protected configuration.

--Mary
 
Back
Top