[Mono-bugs] [Bug 591397] System.Data.DataTableExtensions.CopyToDataTable(Of T) returns 0 Rows

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Mar 26 14:52:49 EDT 2010



--- Comment #4 from Miguel de Icaza <miguel at novell.com> 2010-03-26 18:52:49 UTC ---
Tony, when I run this modified version:

using System.Data;
using System;

class X {
    static void Main ()

        DataTable dt = new DataTable();
        dt.Columns.Add("w", typeof(string));
        dt.Columns.Add("P", typeof(string));
        dt.Rows.Add(new string[] { "A", "A" });
        dt.Rows.Add(new string[] { "B", "B" });
        EnumerableRowCollection<DataRow> o = from DataRow oRow in
            where oRow.Field<string>("w") == "A"
            select oRow;
        DataTable r = o.CopyToDataTable();
        Console.WriteLine ("Must be true => {0}", r.Rows.Count == 1);
        Console.WriteLine ("Must be false -> {0}", (r.Rows[0].IsNull(0)));
                   //string s =(string) o.CopyToDataTable().Rows[0][0];

I get:

mono$ mono t3.exe 
Must be true => True
Must be false -> False

Both before and after the patch.

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list