[Mono-bugs] [Bug 69158][Nor] New - [ODBC] ExecuteScalar throws NullReferenceException

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 5 Nov 2004 17:05:26 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by sebastien.robitaille@croesus.com.

http://bugzilla.ximian.com/show_bug.cgi?id=69158

--- shadow/69158	2004-11-05 17:05:26.000000000 -0500
+++ shadow/69158.tmp.22991	2004-11-05 17:05:26.000000000 -0500
@@ -0,0 +1,56 @@
+Bug#: 69158
+Product: Mono: Class Libraries
+Version: 1.0
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Data
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: sebastien.robitaille@croesus.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [ODBC] ExecuteScalar throws NullReferenceException
+
+Description of Problem:
+
+Since mono-1.0.4, calling ExecuteScalar throws a NullReferenceException.
+(This problem was not present in mono-1.0.2)
+
+The exception:
+System.NullReferenceException: Object reference not set to an instance of 
+an object
+in (unmanaged) (wrapper managed-to-native) 
+System.Data.Odbc.libodbc:SQLFreeHandle (uint16,intptr)
+in <0x00004> (wrapper managed-to-native) 
+System.Data.Odbc.libodbc:SQLFreeHandle (uint16,intptr)
+in <0x000c9> System.Data.Odbc.OdbcDataReader:Close ()
+in <0x0004f> (wrapper remoting-invoke-with-check) 
+System.Data.Odbc.OdbcDataReader:Close ()
+in <0x0007c> System.Data.Odbc.OdbcCommand:ExecuteScalar ()
+in <0x000e7> MyClass:MyMethod(System.Guid)
+
+
+Steps to reproduce the problem:
+
+ODBCConnection dbConnection = new OdbcConnection(connectionString);
+IDbCommand dbCommand = dbConnection.CreateCommand();
+dbCommand.CommandText = "SELECT COUNT(*) FROM MYTABLE";
+int nResult = dbCommand.ExecuteScalar();
+
+
+Actual Results:
+NullReferenceException
+
+Expected Results:
+no exception.
+
+How often does this happen? 
+Always
+
+Additional Information:
+unixODBC-2.2.9