[Mono-bugs] [Bug 60470][Wis] Changed - Exception thrown when infering Xml Schema to DataSet
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Tue, 22 Jun 2004 14:50:41 -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 pbaena@uol.com.ar.
http://bugzilla.ximian.com/show_bug.cgi?id=60470
--- shadow/60470 2004-06-22 14:26:22.000000000 -0400
+++ shadow/60470.tmp.25990 2004-06-22 14:50:41.000000000 -0400
@@ -201,6 +201,65 @@
Shows a <NewDataSet />
Whereas on .NET it throws a dataset filled with the elements.
+
+------- Additional Comments From pbaena@uol.com.ar 2004-06-22 14:50 -------
+Xml generated this way:
+
+
+using System;
+using System.Data;
+using System.IO;
+using System.Xml;
+using System.Text;
+
+class Test {
+
+ public static void Main ()
+ {
+ DataSet newds = new
+DataSet("myData");
+ DataTable myTable = new
+DataTable("myTable");
+ DataColumn c1 = new DataColumn("id",
+Type.GetType("System.Int32"));
+ c1.AutoIncrement= true;
+ myTable.Columns.Add(c1);
+
+
+ DataColumn oc = new
+DataColumn("somecol");
+ myTable.Columns.Add(oc);
+ oc = new DataColumn("othercol");
+ myTable.Columns.Add(oc);
+
+ newds.Tables.Add(myTable);
+
+ DataRow newDataRow =
+newds.Tables[0].NewRow();
+ newDataRow["somecol"] = "blabla";
+ newDataRow["othercol"] = "blublu";
+ newds.Tables[0].Rows.Add(newDataRow);
+
+ newds.AcceptChanges();
+
+ FileStream fsWriteXml = new
+FileStream
+ ("somexml.xml",
+FileMode.Create);
+
+
+ XmlTextWriter xmlWriter = new
+XmlTextWriter
+ (fsWriteXml,
+Encoding.ASCII);
+
+ newds.WriteXml(xmlWriter,
+XmlWriteMode.WriteSchema);
+ fsWriteXml.Close();^M
+ }
+}
+
+