re:
<configuration>
<appSettings>
<add key="ConnectionString"
value="server=localhost;uid=sa;password=MyPwd;data base=MyDB"/>
</appSettings>
Try :
<configuration>
<system.web>
<appSettings>
etc...
The appSettings key must be within <system.web>
btw, check Scott's great pointer on how to encapsulate
your configuration settings :
http://odetocode.com/Articles/345.aspx
Try it. There's more than one way to skin a cat... ;-)
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ :
http://asp.net.do/faq/
Foros de ASP.NET en Español :
http://asp.net.do/foros/
======================================
"Kent Johnson" <08********@telia.com> wrote in message
news:LN*********************@newsc.telia.net...
Everyting is just the same.
It worked yesterday.
In page code behind:
string conn =
System.Configuration.ConfigurationSettings.AppSett ings["ConnectionString"];
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:eq*************@TK2MSFTNGP15.phx.gbl... Kent,
In the connection string you just added are you certain your key name is
the same as the old one?
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Kent Johnson" <08********@telia.com> wrote in message
news:6D*********************@newsc.telia.net... > Hi all,
>
> I have accidentally deleted my web.config file so I'll have to recreate
> it.
>
> I have tried this in my Web.config file:
> <configuration>
> <appSettings>
> <add key="ConnectionString"
> value="server=localhost;uid=sa;password=MyPwd;data base=MyDB"/>
> </appSettings>
>
> When I run this I get:
> "The ConnectionString property has not been initialized."
>
> What can be wrong?
>
> /Kent J.