473,320 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

ConnectionString not initialized..?

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.
Nov 19 '05 #1
5 1712
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.

Nov 19 '05 #2
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.


Nov 19 '05 #3
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.

Nov 19 '05 #4
OK! Great!
Now it works on my localhost!
What is the best way to export my project to production server?
File/Save as/http://MyServer/MyProject...?

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:uJ**************@TK2MSFTNGP12.phx.gbl...
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.


Nov 19 '05 #5
re:
The appSettings key must be within <system.web> Now it works on my localhost!


Good to know!
Sometimes it's the little things which snag us.

:-)

re: What is the best way to export my project to production server?
I usually use "Copy Web", but there's quite a few ways to do that.

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:f0*********************@newsc.telia.net... OK! Great!
Now it works on my localhost!
What is the best way to export my project to production server?
File/Save as/http://MyServer/MyProject...?

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:uJ**************@TK2MSFTNGP12.phx.gbl...
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.



Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: TPSreport | last post by:
I log on to the cookieless application, work within it for awhile, jump to a URL outside the application, then return to the application. As soon as a db call is required, I get the error below. ...
5
by: josephrthomas | last post by:
hi...i am getting a error here...saying : **quote** The ConnectionString property has not been initialized. Description: An unhandled exception occurred during the execution of the current web...
6
by: Tony | last post by:
Dear All, When I run an example program on the http://www.dotnetjunkies.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/data/datagrid1.src&file=VB\datagrid1.aspx&font=3 ...
10
by: Laura K | last post by:
Tried all kinds of things. I get the error. The ConnectionString property has not been initialized. Any help appreciated. ...
2
by: tshad | last post by:
I am trying to create an application in my VS 2002 application. I took some of the code from my web page where it works fine. I can connect fine from my Sql Query Analyser to both my local Sql...
4
by: QC | last post by:
Hi, this morning found that my Service had crashed, and the error was "Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized". I have no...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.