DisconnectedContext was Detected in Converted VB Code Failing Sporatically in VB Studio 2005

I have a project that was imported from VB 6.0 Pro.  I am still using ADO.  The code is designed to report data from Oracle.  If the code is supposed to bring back a small amount of data it runs flawlessly.  If it is to bring back a large amount of data it fails with the following error:

DisconnectedContext was detected
Message: Context 0x4140c0' is disconnected.  Releasing the interfaces from the current context (context 0x413f50).This may cause corruption or data loss. To avoid this problem, please ensure that all contexts/apartments stay alive until the applicationis completely done with the RuntimeCallableWrappers that represent COM components that liveinside them.

This comes up in a small dialog rather than tripping into my error handler or simply stopping on a particular line.  I don't know how to find exactly which line is failing other than examining which data it stops on in the output.  This project is extremely important and I am stuck.  Any help would be greatly appreciated.
Who is Participating?
ericwong27Connect With a Mentor Commented:
You can use the native .NET Oracle class libraries instead of COM Component. The problem solved be able to resolve.

tlchavetAuthor Commented:
Sorry for the delay in responding.  The first step of that article indicates to download a utility and it is taking some time.  I will respond back later tonight as soon as I can test the solution.  Thanks for the direction.
tlchavetAuthor Commented:
The article says to declare the connection as follows:
Dim conn As New OracleConnection() ' VB.NET
However, I get an error on the OracleConnection that it is not defined.  Oracle.DataAccess.dll is added as a reference to my project.
tlchavetAuthor Commented:
Thanks for pointing me in the right direction.  After some more research I found I was missing a step (Imports . . .).  
All Courses

From novice to tech pro — start learning today.