https://bugzilla.novell.com/show_bug.cgi?id=644418

https://bugzilla.novell.com/show_bug.cgi?id=644418#c0


           Summary: DataTable clone fails
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: i386
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Data
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10)
Gecko/20100914 Firefox/3.6.10 ( .NET CLR 3.5.30729; .NET4.0E)

public virtual DataTable Clone () creates a new instance with Activator and
than calls CopyProperties(). 
Code tries to copy all properties from old instance to new one, but if you
clone DataSet generated table, you end up with: "System.ArgumentException: Key
duplication when adding: typedName."


So in code it needs one more condition:

for (int i=0; i < ExtendedProperties.Count; i++)
  if (!Copy.ExtendedProperties.Contains(tgtArray.GetValue (i))
    Copy.ExtendedProperties.Add (tgtArray.GetValue (i),
ExtendedProperties[tgtArray.GetValue (i)]);
}


Reproducible: Always

Steps to Reproduce:
1.Create DataTable
2. Add typedName into ExtendetedProperties
3. do table.Clone()
Actual Results:  
Exception

Expected Results:  
to have a clone

-- 
Configure bugmail: https://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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to