Query XML with Linq to xml -


how retrieve value of element customer, result , reason using linq access.

 <?xml version="1.0"?>  <!doctype createaccount>   <createaccount>   <customer>tonytsund</customer>    <result>failed</result>    <reason>reseller/password combination unknown</reason>    </createaccount> 

try this:

xelement xe = xelement.load(ur xml);     var cusvalue = in xe.elements("customer")                    select a.value;     var resultvalue= in xe.elements("result")                       select a.value;     var reasonvalue= in xe.elements("reason")                       select a.value; 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -