[Mono-bugs] [Bug 60828][Nor] New - Odbc: IndexOutOfRangeException when using ExecuteScalar()

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 28 Jun 2004 10:53:23 -0400 (EDT)


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=60828

--- shadow/60828	2004-06-28 10:53:23.000000000 -0400
+++ shadow/60828.tmp.15641	2004-06-28 10:53:23.000000000 -0400
@@ -0,0 +1,60 @@
+Bug#: 60828
+Product: Mono: Class Libraries
+Version: unspecified
+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: IndexOutOfRangeException when using ExecuteScalar()
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+An exception is thrown when using OdbcCommand.ExecuteScalar()
+
+System.IndexOutOfRangeException: Array index is out of range.
+in <0x00098> System.Data.Odbc.OdbcDataReader:GetValue (int)
+in <0x00054> (wrapper remoting-invoke-with-check) 
+System.Data.Odbc.OdbcDataReader:GetValue (int)
+in <0x00012> System.Data.Odbc.OdbcDataReader:get_Item (int)
+in <0x00054> (wrapper remoting-invoke-with-check) 
+System.Data.Odbc.OdbcDataReader:get_Item (int)
+in <0x00040> System.Data.Odbc.OdbcCommand:ExecuteScalar ()
+...
+
+
+Steps to reproduce the problem:
+1. Execute the following code:
+
+dbConnection.Open();
+IDbCommand dbCommand = dbConnection.CreateCommand();
+dbCommand.CommandText = "SELECT count(*) FROM <TABLENAME>";
+object o = dbCommand.ExecuteScalar();
+
+
+Actual Results:
+Exception thrown.
+
+Expected Results:
+The current record count in <TABLENAME> shoud be returned by ExecuteScalar
+()
+
+How often does this happen? 
+Always.
+
+Additional Information:
+
+Linux Redhat 9
+unixODBC
+mono RC1
+freeTDS
+Sybase 12.5