Click here to Skip to main content
15,849,130 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
Iam saving data in xml file using datatable.Iam getting values perfectly in that xml file.But whenever i save <,> symbols in that time i'm getting < > like that.How to solve this error.

This is My code:

DataTable mydt = new DataTable("MyDataTable");
DataSet newds = new DataSet("MyDataSet");
mydt.Columns.Add("ColumnName", System.Type.GetType("System.String"));
mydt.Columns.Add("Operator", System.Type.GetType("System.String"));
mydt.Columns.Add("Value", System.Type.GetType("System.String"));
mydt.Columns.Add("Conditions", System.Type.GetType("System.String"));
newds.Tables.Add(mydt);
for (count = 0; count < gridcol.Rows.Count; count++)
{
DataRow dr = mydt.NewRow();
dr[0] = gridcol.Rows[count].Cells[0].Text;
dr[1] = gridcol.Rows[count].Cells[1].Text;
dr[2] = gridcol.Rows[count].Cells[2].Text;
dr[3] = gridcol.Rows[count].Cells[3].Text;
mydt.Rows.Add(dr);
}
newds.AcceptChanges();
newds.Tables[0].WriteXml("D:\\Unicampus\\XMLFiles\\" + queryname + ".xml");
anybody can reply please

Thanks & Regards
Hari
Posted
Updated 21-Apr-13 21:50pm
v3

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900