By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,928 Members | 1,773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,928 IT Pros & Developers. It's quick & easy.

System.InvalidOperationException: The ConnectionString property hasnot been initialized.

P: n/a
QC
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 pointer on why this error would happen? Thanks a lot.

Here's the exception:

System.InvalidOperationException: The ConnectionString property has
not been initialized.
at System.Data.SqlClient.SqlConnection.Open()

Jan 11 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Well, what changed? Where is the connection string held?
If it is in the configuration file (which would be common), does the
config file still exist? Is it in the right location? Has anybody been
renaming / moving files? etc

And finally - are you *sure* that there isn't a rarely used (i.e. now)
branch of code that might not have been used in ages, and that this
may simply have a bug?

Marc
Jan 11 '08 #2

P: n/a
QC
On Jan 11, 1:15*pm, "Marc Gravell" <marc.grav...@gmail.comwrote:
Well, what changed? Where is the connection string held?
If it is in the configuration file (which would be common), does the
config file still exist? Is it in the right location? Has anybody been
renaming / moving files? etc

And finally - are you *sure* that there isn't a rarely used (i.e. now)
branch of code that might not have been used in ages, and that this
may simply have a bug?

Marc
Yes, connection string is in Config File, and there were no changes
like rename, not exist etc. all things were same.
Jan 11 '08 #3

P: n/a
QC
On Jan 11, 1:34*pm, QC <AKhandelwal.in...@gmail.comwrote:
On Jan 11, 1:15*pm, "Marc Gravell" <marc.grav...@gmail.comwrote:
Well, what changed? Where is the connection string held?
If it is in the configuration file (which would be common), does the
config file still exist? Is it in the right location? Has anybody been
renaming / moving files? etc
And finally - are you *sure* that there isn't a rarely used (i.e. now)
branch of code that might not have been used in ages, and that this
may simply have a bug?
Marc
Also, in simple way, if there is any changes in Config file, the error
would be at different place, like Node not found / file not found /
Cannot access the file etc.
so the problem is not from the config file, it is from somewhere else,
right?

the same code i used to create the connection, the same code hits
almost 10000+ times daily, so what would be problem?
Jan 11 '08 #4

P: n/a
Also, in simple way, if there is any changes in Config file, the
error
would be at different place
Not if your connection-string lookup code is swallowing the exception
and returning ""...
so what would be problem?
Can't answer that without more detail... such as how you think it gets
set... to be honest, I think you need to trace it throught from
there... somehow it is setting the cs to an empty string, but only the
code can tell you why...

Marc
Jan 11 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.