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

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 27 Apr 2004 22:01:58 -0400 (EDT)


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 atsushi@ximian.com.

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

--- shadow/50468	2004-04-27 22:01:58.000000000 -0400
+++ shadow/50468.tmp.28924	2004-04-27 22:01:58.000000000 -0400
@@ -0,0 +1,76 @@
+Bug#: 50468
+Product: Mono: Class Libraries
+Version: unspecified
+OS: other
+OS Details: 
+Status: CLOSED   
+Resolution: 
+Severity: Unknown
+Priority: Normal
+Component: Sys.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
+
+------- Additional Comments From ginga@kit.hi-ho.ne.jp  2003-12-05 10:43 -------
+This looks XmlTextWriter bug. I fixed related bug. Please check the 
+latest status. As far as I tried, it did not throw.
+
+------- Additional Comments From gsanjay@novell.com  2003-12-08 05:51 -------
+Checked with mcs 0.29. Doesnt throw exceptions any more.
+
+------- Additional Comments From atsushi@ximian.com  2004-04-27 22:01 -------
+This has been already fixed.