473,625 Members | 2,690 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ConnectionStrin g 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:
<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.
Nov 19 '05 #1
5 1729
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.

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


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

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******** ******@TK2MSFTN GP12.phx.gbl...
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.


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********@tel ia.com> wrote in message
news:f0******** *************@n ewsc.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******** ******@TK2MSFTN GP12.phx.gbl...
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.



Nov 19 '05 #6

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

Similar topics

1
10556
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. web.config also below. Thanks in advance for your ideas! TPS error message: The ConnectionString property has not been initialized. Description: An unhandled exception occurred during the
5
1493
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 request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized.
6
6099
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 I received an error message: "The ConnectionString property has not been initialized.
10
2790
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. ----------------------------------------------------------------------------------------------------- This is the web.config info
2
5361
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 Server and off Sql Server machines. But I am getting the following error from my "objConn.Open()". Is this a problem from going from my web to a normal application?
4
4340
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 clue WHY the ConnectionString wouldn't be initialized as I do not play with anything near it in my code. my service is running perfectly from last few years, and the same code executed millions of time. I am using VS 2003, .net 1.1. Do you have any...
0
8182
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8688
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8352
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6115
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4085
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2614
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1800
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.