G
Guest
Hi
I have a scenario in my C#.NET application in which I have to open an ODBC connection to a DB2 database residing on AS/400. The connection needs to be kept open 24/7. I have a simple stored procedure on AS/400 which declares a simple cursor for a simple select statement and opens the cursor
The following steps are done in the application
The above steps work fine. But since these steps are repeated (except the connection opening) every half second in my appliction, after about ~40,000 iterations. The application starts receiving SQL0502 errors (cursor already open) because the cursors opened implicity by the fill method of OdbcDataAdapter were never closed. Is there way for me to explicitly close the cursor which was implicitly opened by the fill method of OdbcDataAdapter without closing the ODBC connection
Your help is appreciated.
I have a scenario in my C#.NET application in which I have to open an ODBC connection to a DB2 database residing on AS/400. The connection needs to be kept open 24/7. I have a simple stored procedure on AS/400 which declares a simple cursor for a simple select statement and opens the cursor
The following steps are done in the application
Connection is opened
An OdbcCommand object is created for calling the stored procedure. The open connection is passed
An OdbcDataAdapter object is created. The above created OdbcCommand is set to the SelectCommand property of the OdbcDataAdapter
A DataSet object is created to store the resulting data
The fill(datasetname) command of the OdbcDataAdapter is used to get the results from the stored procedure
The above steps work fine. But since these steps are repeated (except the connection opening) every half second in my appliction, after about ~40,000 iterations. The application starts receiving SQL0502 errors (cursor already open) because the cursors opened implicity by the fill method of OdbcDataAdapter were never closed. Is there way for me to explicitly close the cursor which was implicitly opened by the fill method of OdbcDataAdapter without closing the ODBC connection
Your help is appreciated.