[Mono-bugs] [Bug 68256][Nor] New - DataSet.GetXmlSchema() incorrectly renders the msdata:ReadOnly attribute for DataColumns not marked as ReadOnly when at least one column in the DataTable is marked ReadOnly

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 13 Oct 2004 15:09:31 -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=68256

--- shadow/68256	2004-10-13 15:09:31.000000000 -0400
+++ shadow/68256.tmp.13312	2004-10-13 15:09:31.000000000 -0400
@@ -0,0 +1,92 @@
+Bug#: 68256
+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() incorrectly renders the msdata:ReadOnly attribute for DataColumns not marked as ReadOnly when at least one column in the DataTable is marked ReadOnly
+
+Steps to reproduce the problem:
+
+Past the following code into a Console App:
+
+DataSet ds = new DataSet("Example");
+
+// Add a DataTable with no ReadOnly columns
+ds.Tables.Add("StandAlone");
+
+// Add a ReadOnly column
+ds.Tables["StandAlone"].Columns.Add(new DataColumn("ID", typeof(int)));
+ds.Tables["StandAlone"].Columns["ID"].AllowDBNull = false;
+
+ds.Tables["StandAlone"].Columns.Add(new DataColumn("Desc", typeof
+(string)));
+ds.Tables["StandAlone"].Columns["Desc"].AllowDBNull = false;
+
+// Add related DataTables with ReadOnly columns
+ds.Tables.Add("Dimension");
+ds.Tables["Dimension"].Columns.Add(new DataColumn("Number", typeof(int)));
+ds.Tables["Dimension"].Columns["Number"].AllowDBNull = false;
+ds.Tables["Dimension"].Columns["Number"].ReadOnly = true;
+
+ds.Tables["Dimension"].Columns.Add(new DataColumn("Title", typeof
+(string)));
+ds.Tables["Dimension"].Columns["Title"].AllowDBNull = false;
+
+ds.Tables["Dimension"].Constraints.Add("PK_Dimension", ds.Tables
+["Dimension"].Columns["Number"], true);
+
+ds.Tables.Add("Element");
+			
+ds.Tables["Element"].Columns.Add(new DataColumn("Dimension", typeof
+(int)));
+ds.Tables["Element"].Columns["Dimension"].AllowDBNull = false;
+ds.Tables["Element"].Columns["Dimension"].ReadOnly = true;
+
+ds.Tables["Element"].Columns.Add(new DataColumn("Number", typeof(int)));
+ds.Tables["Element"].Columns["Number"].AllowDBNull = false;
+ds.Tables["Element"].Columns["Number"].ReadOnly = true;
+
+ds.Tables["Element"].Columns.Add(new DataColumn("Title", typeof(string)));
+ds.Tables["Element"].Columns["Title"].AllowDBNull = false;
+
+ds.Tables["Element"].Constraints.Add("PK_Element", new DataColumn[] { 
+ds.Tables["Element"].Columns["Dimension"], ds.Tables["Element"].Columns
+["Number"] }, true);
+
+ds.Relations.Add("FK_Element_To_Dimension", ds.Tables["Dimension"].Columns
+["Number"], ds.Tables["Element"].Columns["Dimension"]);
+
+ds.AcceptChanges();
+
+System.Console.WriteLine(ds.GetXmlSchema());
+
+Actual Results:
+
+See attached file.
+
+Expected Results:
+
+See attached file.
+
+
+How often does this happen?
+
+Repeatable with the provided code.
+
+
+Additional Information:
+
+If more than one DataColumn in a DataTable is marked as ReadOnly, 
+multiple msdata:ReadOnly tags are rendered on a single element as 
+demonstrated in the example.