[Mono-bugs] [Bug 68005][Nor] New - DataSet.GetXmlSchema() fails to render the msdata:ReadOnly="true" attribute tag for a DataColumn marked as ReadOnly

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 11 Oct 2004 19:29:13 -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 dclough@prconline.com.

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

--- shadow/68005	2004-10-11 19:29:13.000000000 -0400
+++ shadow/68005.tmp.29411	2004-10-11 19:29:13.000000000 -0400
@@ -0,0 +1,82 @@
+Bug#: 68005
+Product: Mono: Class Libraries
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: Fedora Core 2
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Data
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dclough@prconline.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: DataSet.GetXmlSchema() fails to render the msdata:ReadOnly="true" attribute tag for a DataColumn marked as ReadOnly
+
+Steps to reproduce the problem:
+
+Paste the following code into a simple Console App:
+
+DataSet ds = new DataSet("Example");
+
+// Add a DataTable
+ds.Tables.Add("MyTable");
+
+// Add a ReadOnly column
+ds.Tables["MyTable"].Columns.Add(new DataColumn("ID", typeof(int)));
+ds.Tables["MyTable"].Columns["ID"].ReadOnly = true;
+
+ds.AcceptChanges();
+
+System.Console.WriteLine(ds.GetXmlSchema());
+
+Actual Results:
+
+<?xml version="1.0" standalone="yes"?>
+<xs:schema xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" 
+id="Example" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:element name="Example" msdata:IsDataSet="true" msdata:Locale="en-
+US">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element name="MyTable">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element minOccurs="0" name="ID" type="xs:int" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
+
+Expected Results:
+
+<?xml version="1.0" standalone="yes"?>
+<xs:schema id="Example" xmlns="" 
+xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-
+microsoft-com:xml-msdata">
+  <xs:element name="Example" msdata:IsDataSet="true">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element name="MyTable">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="ID" msdata:ReadOnly="true" type="xs:int" 
+minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
+
+
+How often does this happen?
+
+Repeatable with the provided code.