I want to export these xml tags from c#....
<Mujeeb>
<ID>1</ID>
<NAME>Table</NAME>
<ORIGINAL_NAME>Table</ORIGINAL_NAME>
<TYPE>Table</TYPE>
<FORMAT>
<ID>0</ID>
</FORMAT>
</Mujeeb>
But the code i code output different result even after i created the Child and Parent table relationship.
<Mujeeb>
<Mujeeb>
<ID>0</ID>
<NAME>Table</NAME>
<ORIGINAL_NAME>Table</ORIGINAL_NAME>
<TYPE>Table</TYPE>
</Mujeeb>
<FORMAT>
<ID>0</ID>
</FORMAT>
</Mujeeb>
Not sure why is this happening...
I wrote the following code...
-----------------------------------------------------------------
DataSet tempds = new DataSet("Mujeeb");
DataTable temptb;
DataColumn tempcl;
DataColumn temprecl;
DataRow tempdr;
temptb = new DataTable("Mujeeb");
temprecl = new DataColumn("ID", System.Type.GetType("System.Int32"));
temptb.Columns.Add(temprecl);
tempcl = new DataColumn("NAME", System.Type.GetType("System.String"));
temptb.Columns.Add(tempcl);
tempcl = new DataColumn("ORIGINAL_NAME", System.Type.GetType("System.String"));
temptb.Columns.Add(tempcl);
tempcl = new DataColumn("TYPE", System.Type.GetType("System.String"));
temptb.Columns.Add(tempcl);
tempdr = temptb.NewRow();
tempdr["ID"] = 0;
tempdr["Name"] = "Table";
tempdr["ORIGINAL_NAME"] = "Table";
tempdr["TYPE"] = "Table";
temptb.Rows.Add(tempdr);
tempds.Tables.Add(temptb);
temptb = new DataTable("FORMAT");
temprecl = new DataColumn("ID", System.Type.GetType("System.Int32"));
temptb.Columns.Add(temprecl);
tempdr = temptb.NewRow();
tempdr["GMARoot_ID"] = 0;
temptb.Rows.Add(tempdr);
tempds.Tables.Add(temptb);
tempds.Tables["Mujeeb"].ChildRelations.Add("Mujeeb_FORMAT", tempds.Tables["Mujeeb"].Columns["ID"], tempds.Tables["FORMAT"].Columns["ID"]);
-------------------------------------------------------------------
Can anyone please help me out in this...
Thx,
Mujeeb.