DataSet to JSON
string jsonValue = JsonConvert.SerializeObject(objUserValidation, Formatting.Indented);
JSON to DataSet
using Newtonsoft.Json;
System.Data.DataSet ds = new System.Data.DataSet();
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
//jsonValue it contains json value
xd = (System.Xml.XmlDocument)JsonConvert.DeserializeXmlNode(jsonValue.ToString(), "jsonValue");
ds.ReadXml(new System.Xml.XmlNodeReader(xd));
using Newtonsoft.Json;//objUserValidation is dataset variable and it contains tables
string jsonValue = JsonConvert.SerializeObject(objUserValidation, Formatting.Indented);
JSON to DataSet
using Newtonsoft.Json;
System.Data.DataSet ds = new System.Data.DataSet();
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
//jsonValue it contains json value
xd = (System.Xml.XmlDocument)JsonConvert.DeserializeXmlNode(jsonValue.ToString(), "jsonValue");
ds.ReadXml(new System.Xml.XmlNodeReader(xd));
No comments:
Post a Comment