Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

System.InvalidOperationException: The ConnectionString property has     not been initialized.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
QC - 11 Jan 2008 07:54 GMT
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()
Marc Gravell - 11 Jan 2008 08:15 GMT
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
QC - 11 Jan 2008 08:34 GMT
> Well, what changed? Where is the connection string held?
> If it is in the configuration file (which would be common), does the
[quoted text clipped - 6 lines]
>
> Marc

Yes, connection string is in Config File, and there were no changes
like rename, not exist etc. all things were same.
QC - 11 Jan 2008 09:31 GMT
> > Well, what changed? Where is the connection string held?
> > If it is in the configuration file (which would be common), does the
[quoted text clipped - 6 lines]
>
> > 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?
Marc Gravell - 11 Jan 2008 09:41 GMT
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.