I have a VB.NET prog that checks a number of tables for records belonging to a specific person.
It's an Oracle db.
Obviously, I use a lot of recordsets in the process.
I free them using the ADO 2.7 dispose method.
At a certain point, I get an error:
ORA-01000: maximum open cursors exceeded
ORA-00604: error occurred at recursive SQL level 1
Sure I can increase the maximum number of open cursors for the connection, but that's not the point.
It seems that the dispose method does not free the recordsets. The ADO com objects still live in the eyes of the database. Before the prog was converted to VB.NET, I freed them the regular VB6 way, just set them to nothing.
SO MY QUESTION IS:
What does this dispose method do exactly if it doesn't force the object to be garbage collected ?
I don't want to use the System.GC.Collect function every time.
In a .NET article I encountered the function
Should I use this one ? In that case, do I still have to use the dispose method or set-to-nothing ?
Help would be appreciated.
Note: I use a lot of commands too. These are freed the old way: set them to nothing, the Garbage Collector can do the rest. Normally this shouldn't affect the situation
described, right ?