I am using XML file as config file in my automation tool which I have developed to store all the inputs/settings/run time config value etc etc. Because it easy for manual guys also to just open XML file in Notepad and alter the setting based on their requirement and it’s easy to maintain also.
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 path
//Read all the value to the xml read command
System.IO.FileStream fsReadXml = new System.IO.FileStream(xmlPath,
//Declare a dataset to hold all the XML value
DataSet ds = new DataSet();
//Read the value from XML reader to the dataset
catch (Exception ex)
//Close the reader.
//your dataset (ds) would be having all the data stored from XML file.