[Mono-bugs] [Bug 50468][Nor] New - DataSet.WriteXml with WriteSchema mode throws an exception

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 2 Nov 2003 19:00:51 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by lmaloney@bigpond.net.au.

http://bugzilla.ximian.com/show_bug.cgi?id=50468

--- shadow/50468	2003-11-02 19:00:50.000000000 -0500
+++ shadow/50468.tmp.5137	2003-11-02 19:00:51.000000000 -0500
@@ -0,0 +1,66 @@
+Bug#: 50468
+Product: Mono/Class Libraries
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System.Data
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lmaloney@bigpond.net.au               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: DataSet.WriteXml with WriteSchema mode throws an exception
+
+Description of Problem:
+
+Using DataSet.WriteXml(filename, XmlWriteMode.WriteSchema) throws
+System.ArgumentException: Key duplication when adding: msdata in
+System.Collections.Hashtable:PutImpl.
+
+Steps to reproduce the problem:
+
+DataSetTest.cs:
+using System;
+using System.Data;
+
+public class DataSetTest
+{
+	public static void Main()
+	{
+		DataSet set;
+		DataTable data;
+
+		set = new DataSet();
+
+		data = set.Tables.Add("MyTable");
+
+		data.Columns.Add(new DataColumn("Column1", Type.GetType("System.String")));
+		set.WriteXml("Text.xml", XmlWriteMode.WriteSchema);
+	}
+}
+
+Compile with: mcs /r:System.Data.dll DataSetTest.cs
+
+Actual Results:
+
+Unhandled Exception: System.ArgumentException: Key duplication when adding:
+msdata
+in <0x0026b> System.Collections.Hashtable:PutImpl (object,object,bool)
+in <0x00019> System.Collections.Hashtable:Add (object,object)
+in <0x0047f> System.Xml.XmlTextWriter:WriteStartAttribute
+(string,string,string)
+
+
+Expected Results:
+
+This should write an xml file with the schema.  It works correctly with MS
+.NET.
+
+How often does this happen? 
+
+Always