Convert XmlDocument to XElement
XmlElement x = objXmlDocument.documentElement;
You might need this if you are creating a WCF service that accepts XElement as parameter but user has a dataset to be converted to Xelement
XmlDocument xDoc = new XmlDataDocument(YourDataset);
XmlElement x = xDoc.DocumentElement;
example:You might need this if you are creating a WCF service that accepts XElement as parameter but user has a dataset to be converted to Xelement
XmlDocument xDoc = new XmlDataDocument(YourDataset);
XmlElement x = xDoc.DocumentElement;
DataSet ds = new DataSet();
ds.Tables.Add("students"); ds.Tables[0].Columns.Add("Name");
DataRow dr1 = ds.Tables[0].NewRow(); dr1[0] = "Alan"; ds.Tables[0].Rows.Add(dr1);
XmlDocument xDoc = new XmlDataDocument(ds);
XmlElement x = xDoc.DocumentElement;
Comments
Post a Comment