Below is the code which I am using to Read data from XML file and store in to Data set for further use.
//Local vaible to get xml pathstring xmlPath=”Inputs.xml”;
//Read all the value to the xml read command
System.IO.FileStream fsReadXml = new System.IO.FileStream(xmlPath,
System.IO.FileMode.Open);
//Declare a dataset to hold all the XML value
DataSet ds = new DataSet();
try
{
//Read the value from XML reader to the dataset
ds.ReadXml(fsReadXml);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
finally
{
//Close the reader.
fsReadXml.Close();
}
//your dataset (ds) would be having all the data stored from XML file.
Thanks,
Md.Jawed