How do we read XML Schema and Data into a Dataset ?
Ans)
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 = "Add an xml data"
System.IO.StringReader xmlSR = new System.IO.StringReader(strXMLData);
DemoDataSet .ReadXml(xmlSR, XmlReadMode.IgnoreSchema);
Ans)
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 = "Add an xml data"
System.IO.StringReader xmlSR = new System.IO.StringReader(strXMLData);
DemoDataSet .ReadXml(xmlSR, XmlReadMode.IgnoreSchema);
0 comments: