[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 878
  • 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
2 Solutions
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.
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.

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

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