[Mono-devel-list] [Patch] 60828 - OdbcCommand:ExecuteScalar Problem.

T Sureshkumar TSureshkumar at novell.com
Wed Jun 30 06:13:52 EDT 2004


  Attached is a small patch for the bugzilla id 60828. The bug is that OdbcCommand:ExecuteScalar throws out-of-range exception. This one line patch fixes the problem. If the patch is OK, I will do check-in into CVS. Please review this and let me know.

Bug : 60828 
60828 Mono: Class Libraries - unspecified Sys.Data NEW Odbc: IndexOutOfRangeException when using ExecuteScalar() 
Opened by sebastien.robitaille at croesus.com (Sébastien Robitaille) on 2004-06-28 10:53 Long Description 
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: 
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? 
Additional Information: 
Linux Redhat 9 
mono RC1 
Sybase 12.5 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 60828_patch.diff
Type: application/octet-stream
Size: 595 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040630/4c7ef722/attachment.obj 

More information about the Mono-devel-list mailing list