Subhash Sharma

Subhash Sharma
Subhash Sharma

This is Subhash Sharma(Software Engineer) Blog

Welcome to this blog and find every solution.............

Search This Blog

Software Engineer(Subhash Sharma)

Software Engineer(Subhash Sharma)
Software Engineer

Wednesday, July 28, 2010

Bind Combo Through XML

XmlDocument xml = new XmlDocument();
// xml.LoadXml(@"c:\abc.xml"); // suppose that myXmlString contains "..."
xml.Load(@"c:\abc.xml");
XmlNodeList xnList = xml.SelectNodes("/NewDataSet/Table");
foreach (XmlNode xn in xnList)
{
string firstName = xn["Sno"].InnerText;
string lastName = xn["CustomerName"].InnerText;
DropDownList1.Items.Add(lastName);
DropDownList1.Items[0].Value = firstName;
}

No comments:

Post a Comment