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

x
  • 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
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

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