You can read the xml in the DataSet and pass the empdetails DataSet to the DataGridView as follows:
//Create xml reader XmlReader xmlFile = XmlReader.Create("fullPathToYourXmlFile.xml", new XmlReaderSettings()); DataSet dataSet = new DataSet(); //Read xml to dataset dataSet.ReadXml(xmlFile); //Pass empdetails table to datagridview datasource dataGridView.DataSource = dataSet.Tables["empdetails"]; //Close xml reader xmlFile.Close();
source share