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

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Mar 26 07:47:10 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=591397

http://bugzilla.novell.com/show_bug.cgi?id=591397#c0


           Summary: System.Data.DataTableExtensions.CopyToDataTable(Of T)
                    returns 0 Rows
    Classification: Mono
           Product: Cocoa#
           Version: unspecified
          Platform: All
        OS/Version: Windows XP
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Bindings.
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: tonyvfish at googlemail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=350804)
 --> (http://bugzilla.novell.com/attachment.cgi?id=350804)
Fixed version of RowEnumerableDataReader.cs

User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022;
NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.0.3705; FDM)

I Did some testing using the a .Net Framework 2.0 and the dataexentensions from 
Mono and discovered several related bugs around CopyToDataTable which I have
fixed.  The main issue is if make a call from .Net client 

o.CopyToDataTable 
where o is defined as  Data.EnumerableRowCollection(Of DataRow) 
o returns a table with 0 rows

Reproducible: Always

Steps to Reproduce:
1.Create small dummy app in .Net 2
2.Reference Mono dataextensons library dataextensions.dll
3.Enter the following code

Dim dt As New DataTable()
        dt.Columns.Add("w", GetType(String))
        dt.Columns.Add("P", GetType(String))
        dt.Rows.Add(New String() {"A", "A"})
        dt.Rows.Add(New String() {"A", "A"})
        dt.Rows.Add(New String() {"C"})
        Dim o As Data.EnumerableRowCollection(Of DataRow) = From oRow In dt _
        Where oRow.Field(Of String)("w") = "A" _
        Select oRow

'This will return zero rows
o.CopyToDataTable

'this will also fail
o.ToArray().CopyToDataTable
Actual Results:  
table returns 0 rows

Expected Results:  
table should be populated with rows

Please find attached the fixed version with comments

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