Hi there is a solution reading xml file to add dataset (i think u want
that)
private XmlDocument myDoc = new XmlDocument();
private DataSet myDs;
//Using XmlElement you can access
//host ,user etc. values
//just write myElemet.GetAttribute("host"); or whatever u want to take
private XmlElement myElemet;
private void LoadDataGrid()
{
myDs = new DataSet();
myDs.ReadXml("myXML.xml");
dataGrid1.DataSource = myDs.Tables[0];
}
private void LoadXML(){
myDoc.Load("your_file.xml");
}
private void Form1_Load(object sender, System.EventArgs e){
LoadDataGrid();
LoadXML();
}
Alan T yazdi:
This is my xml file content:
<?xml version="1.0"?>
<server>
<mssqlChicago>
<host>www.chicagoserver.com</host>
<user>managerA</user>
<password>ceoman</password>
<db>dbCEO</db>
</mssqlChicago>
<mssqlLA>
<host>www.LAserver.com</host>
<user>managerB</user>
<password>laman </password>
<db>dbLAWork</db>
</mssqlLA>
</server>
Any sample code to read these 2 nodes from the xml file?