react-social-login

The easiest way to integrate Social Login in your React Apps ...Checkout NPM

Friday, November 26, 2010

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:
 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;