[Mono-bugs] [Bug 69064][Wis] New - DataSet.WriteXml bug when using Relations

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 3 Nov 2004 13:48:26 -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 ivvy@mail.ru.

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

--- shadow/69064	2004-11-03 13:48:26.000000000 -0500
+++ shadow/69064.tmp.8117	2004-11-03 13:48:26.000000000 -0500
@@ -0,0 +1,75 @@
+Bug#: 69064
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.Data
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: ivvy@mail.ru               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: DataSet.WriteXml bug when using Relations 
+
+Steps to reproduce the problem:
+1. Code:
+		private DataSet ds = new DataSet("Main");
+		private DataTable dtOper = new DataTable("Oper");
+		private DataTable dtGroups = new DataTable("Groups");
+		//Constructor
+		public frmMain()
+		{
+			//init dtOper
+			DataColumn _col = null;
+			_col = dtOper.Columns.Add("Id", typeof(int));
+			_col.AutoIncrement = true;
+			_col.AutoIncrementSeed =1;
+			_col = dtOper.Columns.Add("Date", typeof(DateTime));
+			_col.DefaultValue = DateTime.Now;
+			_col = dtOper.Columns.Add("Group", typeof(int));
+			_col.DefaultValue = 0;
+			_col = dtOper.Columns.Add("Description", typeof(string));
+			_col.DefaultValue = "<<new record>>";
+			_col = dtOper.Columns.Add("Summa", typeof(double));
+			_col.DefaultValue = 0.00;
+			dtOper.PrimaryKey = new DataColumn[] {dtOper.Columns["Id"]};
+			
+			_col = dtGroups.Columns.Add("Id", typeof(int));
+			_col.AutoIncrement = true;
+			_col.AutoIncrementSeed =1;
+			_col = dtGroups.Columns.Add("Name", typeof(string));
+			_col.DefaultValue = "<<New group>>";
+			dtGroups.PrimaryKey = new DataColumn[] {dtGroups.Columns["Id"]};
+			
+			ds.Tables.Add(dtOper);
+			ds.Tables.Add(dtGroups);
+//!!!This is a problem string!!!		
+ds.Relations.Add(dtGroups.Columns["Id"],dtOper.Columns["Group"]);
+
+			//Load data if exists
+			if(System.IO.File.Exists("data.xml"))
+			{
+				ds.ReadXml("data.xml");
+			}
+}//Constructor
+
+//On form closing
+		private void on_WinMainDestroyed(object sender, EventArgs e)
+		{
+			ds.WriteXml("data.xml");
+			Application.Quit();
+		}//on_WinMainDestroyed
+
+
+2. When compiling this code under Windows2000 - mono 1.0.2 DataSet write
+XML-data correctly. When compiling this code under Linux FedoraCore2 - Mono
+1.1 in XML-data wtites only dtGroups? if Relations is using. If comment
+"//!!!" code I have correct XML-data
+
+How often does this happen? 
+Every time