Gautam Buddha Temple Varanasi,Varanasi - Buddhist Pilgrimage

Monday, August 11, 2014

Read a single node from xml (C# String) in C#/.net

 I want to pass the ID as a input parameter of the given xml that will search the XML document for that value within the <id> node.   
 Once ID found ,I want to find the next node and return it's name as a string.  
 Given xml as folloing:  
   <Add>Navi Mumbai</Add>  
 This Linq to xml query will return IEnumerbale<string> of value elements, which matched your id. You need to sure ID should be  
 unquine in given xml.  
 string value = doc.Descendants("Setting")  
            .Where(v => (string)v.Element("ID") == Id)  
            .Select(v => (string)v.Element("Name"))  


  1. This blog having the details of Processes running. The way of runing is explained clearly. The content quality is really great. The full document is entirely amazing. Thank you very much for this blog.
    Seo Company in Chennai


  2. Its very useful to me. Wonderful blog.. Thanks for sharing informative Post.

    Installment loans
    Payday loans
    Title loans


  3. This information is impressive; I am inspired with your post writing style & how continuously you describe this topic.

    Pawn Shop

    Pawn Loans

    Pawn Shops

    Pawn Loan

    Pawn Shop near me