re:
<configuratio n>
<appSettings>
<add key="Connection String"
value="server=l ocalhost;uid=sa ;password=MyPwd ;database=MyDB"/>
</appSettings>
Try :
<configuratio n>
<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********@tel ia.com> wrote in message
news:LN******** *************@n ewsc.telia.net. ..
Everyting is just the same.
It worked yesterday.
In page code behind:
string conn =
System.Configur ation.Configura tionSettings.Ap pSettings["ConnectionStri ng"];
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate. com> wrote in
message news:eq******** *****@TK2MSFTNG P15.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********@tel ia.com> wrote in message
news:6D******** *************@n ewsc.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:
> <configuratio n>
> <appSettings>
> <add key="Connection String"
> value="server=l ocalhost;uid=sa ;password=MyPwd ;database=MyDB"/>
> </appSettings>
>
> When I run this I get:
> "The ConnectionStrin g property has not been initialized."
>
> What can be wrong?
>
> /Kent J.