[Mono-bugs] [Bug 68432][Nor] New - DataSet.GetXmlSchema() incorrectly renders the msdata:ReadOnly attribute for non-readonly DataColumns with ColumnMapping = Attribute

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 15 Oct 2004 14:37:34 -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=68432

--- shadow/68432	2004-10-15 14:37:34.000000000 -0400
+++ shadow/68432.tmp.22468	2004-10-15 14:37:34.000000000 -0400
@@ -0,0 +1,98 @@
+Bug#: 68432
+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 non-readonly DataColumns with ColumnMapping = Attribute
+
+Steps to reproduce the problem:
+
+Paste the following code into a Console App:
+
+// Example 1
+
+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), "", 
+MappingType.Attribute));
+ds.Tables["StandAlone"].Columns["ID"].AllowDBNull = false;
+
+ds.Tables["StandAlone"].Columns.Add(new DataColumn("Desc", typeof
+(string), "", MappingType.Attribute));
+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), "", MappingType.Attribute));
+ds.Tables["Dimension"].Columns["Number"].AllowDBNull = false;
+ds.Tables["Dimension"].Columns["Number"].ReadOnly = true;
+
+ds.Tables["Dimension"].Columns.Add(new DataColumn("Title", typeof
+(string), "", MappingType.Attribute));
+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), "", MappingType.Attribute));
+ds.Tables["Element"].Columns["Dimension"].AllowDBNull = false;
+ds.Tables["Element"].Columns["Dimension"].ReadOnly = true;
+
+ds.Tables["Element"].Columns.Add(new DataColumn("Number", typeof
+(int), "", MappingType.Attribute));
+ds.Tables["Element"].Columns["Number"].AllowDBNull = false;
+ds.Tables["Element"].Columns["Number"].ReadOnly = true;
+
+ds.Tables["Element"].Columns.Add(new DataColumn("Title", typeof
+(string), "", MappingType.Attribute));
+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 given code.
+
+
+Additional Information:
+
+The fix for bug #68256 fixed the problem when a DataColumn had 
+MappingType = Element, but the bug persists with DataColumn having 
+MappingType = Attribute.