Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • LINQ To XML

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 29
    Comment on it

    While using Language Integrated Query with XML we first create an XML file or have data into database in XML form

     

    This is our XML file

     

    Ex: Himanshu Joshi 04/06/2010 Mayank Aggrawal 12/12/1997

     

    To read these details we will write code for it

     

     //Load the file to transform.
    
     XPathDocument doc = new XPathDocument(filename);
    
    
     //Create an XmlTextWriter which outputs to the console.
    
    
     XmlTextWriter writer = new XmlTextWriter(Console.Out); 
    
    
    //Transform the file and send the output to the console.
    
    
     xslt.Transform(doc, null, writer, null); 
    
    
    
      writer.Close(); 

     

    The XPathDocument is used to load the XML file which contains the details of the employees.

    After that we have used the XMLTextWriter class that is used to output the data form the file.

    The XSLT transform is the class that is mainly used to deal with the design and CSS part of the XML file.

    Here we are first loading the document into it and after that printing the output into the console.

    .net

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: