Saturday, 31 January 2015

handling Dataset to readXml composed of multiple tables



I have merged two datasets(Customers,Employees) and write it to an xml file. now when I read the xml back in another Dataset.and check value from employee rows it displays nothing as it iterates first through customers and displays empty line for each customer row and then reaches at Employees and displays data below.



DataSet Ds = new DataSet();
Ds.ReadXml(@"f:/faisal.xml");
Ds.ReadXmlSchema(@"f:/faisal.xsd");
for (int i = 0; i < Ds.Tables[0].Rows.Count;i++ )
{
if (Ds.Tables[0].Rows[i]["TerritoryID"]!=null)
{
Response.Write(Ds.Tables[0].Rows[i]["TerritoryID"] + "<br/>");
}


is there any way to ignore response.write when there is blank line to display.


No comments:

Post a Comment