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
2 comments:
Hello,
This is a inquiry for the webmaster/admin here at www.blogger.com.
May I use part of the information from your blog post above if I provide a backlink back to this site?
Thanks,
James
Sure you can !!
Post a Comment