- Get link
- X
- Other Apps
Posted by
Real
- Get link
- X
- Other Apps
Below is the function to Create DataSet from XML String:
public DataSet ConvertXMLToDataSet(string xmlData)
{
StringReader stream = null;
XmlTextReader reader = null;
try
{
DataSet xmlDS = new DataSet();
stream = new StringReader(xmlData);
// Load the XmlTextReader from the stream
reader = new XmlTextReader(stream);
// xmlDS.Tables.Add("Data");
xmlDS.ReadXml(reader);
return xmlDS;
}
catch (Exception ex)
{
return null;
}
finally
{
if (reader != null) reader.Close();
}
}
Comments
Post a Comment
Thanking you for the comment.