[Mono-devel-list] bug in System.Data.Common.DbDataRecord.GetValues(object[] values)

eran erand at mainsoft.com
Tue Sep 16 09:12:39 EDT 2003

The method System.Data.Common.DbDataRecord.GetValues(object[] values)
doesn't put the values of the DbDataRecord into values parameter.
Steps to reproduce the problem:
1.	create a database (testdb) that contains table (table1) with 2
columns (ID int, NAME varchar)
        CREATE TABLE table1 (ID integer, NAME varchar(50));
   2. add some rows to the table.
      3. do the following code :
            SqlConnection myConnection = new
      SqlCommand myCommand = new SqlCommand("SELECT ID, NAME FROM
table1", myConnection);
      SqlDataReader reader = myCommand.ExecuteReader();
      foreach (object o in reader)
            System.Data.Common.DbDataRecord rec =
            object[] objs = new object[rec.FieldCount];
            Console.WriteLine("Values from GetValues(object[] values)");
Console.WriteLine("Values from GetValue(int index)");
Actual Results:
the values from GetValues(object[] values) are null, and values from
GetValue(int index) are not null.
Expected Results:
same result from GetValues(object[] values) and GetValues(int index).
Enclosed is a small test case and a patch.
Thanks a lot,
Eran Domb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030916/8bd98b2d/attachment.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TestCase.cs
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030916/8bd98b2d/attachment.pl 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DbDataRecord.cs.diff
Type: application/octet-stream
Size: 669 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030916/8bd98b2d/attachment.obj 

More information about the Mono-devel-list mailing list