hi i am facing a problem..
the thing is that i have to populate the xml form datset based on the dataset values.How to add the root element and child elmets according to tht
here is my code.. pls help me out
protected void Button1_Click(object sender, EventArgs e)
{
strXML =;
strXML+= "";
strXML += "";
strXML += "";
strXML += "";
strXML += "";
strXML += "";
strXML += "";
SqlDataAdapter da = new SqlDataAdapter("select * from Test_Gantt", con);
DataSet ds = new DataSet();
da.Fill(ds, "ds");
//Iterate through each Record
foreach (DataRow dr in ds.Tables[0].Rows)
{
strXML += "";
}
con.Close();
strXML += "";
strXML += "";
FileStream fs = new FileStream(Server.MapPath("My_ Xml_ Files/emp6.xml"), FileMode.Create);
fs.Write(strXML);
}
code.txt