• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 888
  • Last Modified:

just-in-time (JIT) debugging error System.InvalidOperationException

Hi Expert,
I develop an application to masked the blob field data in a database.
It masked the field record by record.
If the number of records is ok example 1 million, everything run fine.
But after one million, sometimes it will prompt out error below.
Why it happend? and only occurred sometimes

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidOperationException: ConnectionString may not be set on an
open connection.
   at System.Data.OracleClient.OracleConnection.set_ConnectionString(String
value)
error.JPG
0
yuching
Asked:
yuching
2 Solutions
 
alex_pavenCommented:
It seems that somehow you're not closing the database connection under certain conditions. Without code to look at, I can't offer a much more comprehensive solution.
0
 
MrJesse34Commented:
The answer is to make sure you do a .Close() and a .Dispose() before your code exits.

Also, all data queries should be wrapped in "using" statements.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now