Answer: We can read the XML Schema and data into Dataset using --
Dataset.ReadXml command.
example Follows :
DataSet DemoDataSet = new DataSet();
DataTable DemoDataTable = new DataTable("Table Name");
DemoDataTable .Columns.Add("Column Name", typeof(string));
DemoDataSet .Tables.Add(DemoDataTable);
string strXMLData = "<XmlDS><table1><col1>Value1</col1></table1><table1><col1>Value2</col1></table1></XmlDS>";
System.IO.StringReader xmlSR = new System.IO.StringReader(strXMLData);
DemoDataSet .ReadXml(xmlSR, XmlReadMode.IgnoreSchema);
Source: MSDN | Asked In: Many Interviews |
Alert Moderator