XML To DataSet - CSharp System.Xml

CSharp examples for System.Xml:XML DataSet

Description

XML To DataSet

Demo Code


using System.IO;/*from ww  w. ja v  a 2s.com*/
using System.Data;
using System.Collections;

public class Main{
        public static DataSet XMLToDataSet(string xmlData)
        {
            DataSet result;
            if (!string.IsNullOrEmpty(xmlData))
            {
                DataSet ds = new DataSet();
                ds.ReadXml(new StringReader(xmlData));
                result = ds;
            }
            else
            {
                result = null;
            }
            return result;
        }
}

Related Tutorials