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;

5 comments :

  1. That will actually return an XmlElement, not an XElement (which you can then pass to the web service)

    ReplyDelete
  2. My brother recommenԁed I would possiblу like
    this websitе. Hе was once totally rіght.
    This publish truly made my dаy. You can not bеliеѵе just
    how muсh time I had spent for this info! Thank yоu!
    my page > v2 cigs 15 coupon code

    ReplyDelete
  3. Thanks for liking blog. Quite encouraging!

    ReplyDelete
  4. Nice blog here! Also уour wеbsіte loadѕ uр faѕt!
    What web host are you using? Ϲan I get your аffіliаte linκ tο your host?
    I ωish my ѕite loadеԁ up as quiсkly aѕ уourѕ lol
    My blog post : v2 cig coupons

    ReplyDelete

What are your thoughts on this post? Did you like it?