private void FreeHandles() { if (dbHandle != IntPtr.Zero) { short sqlRet = DB2CLIWrapper.SQLDisconnect(dbHandle); // Note that SQLDisconnect() automatically drops any statements and // descriptors open on the connection. sqlRet = DB2CLIWrapper.SQLFreeHandle(DB2Constants.SQL_HANDLE_DBC, dbHandle); dbHandle = IntPtr.Zero; } }