[Mono-bugs] [Bug 70961][Nor] New - DataSet with Column of MappingType = Attribute does not deserialize properly

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 3 Jan 2005 16:50:19 -0500 (EST)


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=70961

--- shadow/70961	2005-01-03 16:50:19.000000000 -0500
+++ shadow/70961.tmp.15608	2005-01-03 16:50:19.000000000 -0500
@@ -0,0 +1,84 @@
+Bug#: 70961
+Product: Mono: Class Libraries
+Version: 1.0
+OS: Solaris 8
+OS Details: 
+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 with Column of MappingType = Attribute does not deserialize properly
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+
+Paste the following code into a simple console app to recreate the error:
+
+string filePath = @"/usr/people/dclough/mono/exe/serialized.xml";
+
+DataSet quota = new DataSet("Quota");
+
+// Dimension
+quota.Tables.Add("Dimension");
+
+quota.Tables["Dimension"].Columns.Add("Number", typeof(int));
+quota.Tables["Dimension"].Columns["Number"].AllowDBNull = false;
+quota.Tables["Dimension"].Columns["Number"].ColumnMapping = 
+MappingType.Attribute;
+
+quota.Tables["Dimension"].Columns.Add("Title", typeof(string));
+quota.Tables["Dimension"].Columns["Title"].AllowDBNull = false;
+quota.Tables["Dimension"].Columns["Title"].ColumnMapping = 
+MappingType.Attribute;
+
+quota.Tables["Dimension"].Rows.Add(new object[] { 0, "Hospitals" });
+quota.Tables["Dimension"].Rows.Add(new object[] { 1, "Doctors" });
+
+quota.Tables["Dimension"].Constraints.Add("PK_Dimension", quota.Tables
+["Dimension"].Columns["Number"], true);
+
+quota.AcceptChanges();
+
+XmlSerializer ser = new XmlSerializer(quota.GetType());
+FileStream f = File.Create(filePath);
+
+try
+{
+        ser.Serialize(f, quota);
+        f.Close();
+
+	f = File.Open(filePath, FileMode.Open, FileAccess.Read, 
+FileShare.Read);
+	object obj = ser.Deserialize(f);
+}
+catch (Exception ex)
+{
+	System.Console.WriteLine(ex);
+} 
+
+Actual Results:
+
+The above code throws an exception upon deserialization.
+
+Expected Results:
+
+The serialized data in the file should be deserialized with a DataSet 
+created.
+
+How often does this happen?
+
+Repeatable with the above code.
+
+
+Additional Information:
+
+I believe the code to be altered is in the LoadColumns method of the 
+XmlDiffLoader class.