Results 1 to 5 of 5

Thread: Xml with C# in .NET programming

  1. #1
    Join Date
    Dec 2009

    Xml with C# in .NET programming

    I am a newbie for .Net programming with C# languages.I need to know that how many different types of operations can be possible with the manipulation of C#.NET and XML.Like creating XML document and reading it from the source.If you have some suggestion then please share and guide with me.
    Last edited by Remedy; 03-03-2010 at 06:15 PM.

  2. #2
    Join Date
    Apr 2008

    Xml with C# in .NET programming

    Same as the HTML, XML collects and exchanges data.The programmer who needed to use the XML file can create a separate XML files to store the data and that may be used as a data source for HTML.Its not only for HTML,the other applications can use it.

    The file is created and the data is stored in the tags which is same as HTML can use any editor to create the XML file and save it with the .XML extension.

    <?xml version ='1.0'?>
        <title>Fundamentals of Algorithm..</title>
    The .... shows the same procedure would be followed for next record.

  3. #3
    Join Date
    May 2008

    Reading XML in C# programming

    Reading XML in C#

    This section will show you, how to read the XML data from application.Suppose a simple xml file has been created already named books.xml which is stored in C drive in the documents folder.

    XmlTextReader txt_Rder = new XmlTextReader("C:\\books.xml");
    You can use this above statement between the codes where you need to read the XML files.

  4. #4
    Join Date
    May 2008

    Writing on XML files from C#

    Writing on XML files from C#:

    As the same process of reading the data from xml files,you also can insert new data in the XMl file.One of the XmlWriter class contains the capacity to write the contents to XML documents.It contains some functions and properties which is used to write on to the XML documents.

    I am going to show you an example for which I will create a file named myXml_data.xml would be stored into C:\\ root directory.

    The writing statement would be as follows which can be included in the large code:

    XmlTextWriter textWriter = new XmlTextWriter("C:\\myXmFile.xml", null) ; // the code to create the file in C drive.

    Now call WriteEndDocument and TextWriter's Close method using the following statement-


  5. #5
    Join Date
    May 2008

    Creating an XML document with C#

    I am going to show you a code demo which can be used to create a simple XMl file and later can be used to store the data.The code to create an XML file would be as follows-

    using System;
    using System.Xml;
    namespace PavelTsekov
    class MainClass
    XmlDocument xmldcs;
    XmlNode xmlnd;
    XmlElement xmlelement;
    XmlElement xmlelement2;
    XmlText xmltxt;
    static void Main(string[] args)
    MainClass aplctn =new MainClass();
    public MainClass() 
    xmldcs=new XmlDocument();
    xmltxt=xmldcs.CreateTextNode("This is the text of the root element");
    xmltxt=xmldcs.CreateTextNode("The text of the sample element");
    catch (Exception e)

Similar Threads

  1. What does CVS mean in programming?
    By Gajananvihari in forum Software Development
    Replies: 5
    Last Post: 12-03-2010, 04:09 PM
  2. What does DOM mean in programming?
    By Gadin in forum Software Development
    Replies: 5
    Last Post: 11-03-2010, 04:33 PM
  3. Socket programming: Is any new Programming Language?
    By Kushan in forum Software Development
    Replies: 3
    Last Post: 14-11-2009, 10:13 AM
  4. Programming - Mat
    By garfield1 in forum Software Development
    Replies: 7
    Last Post: 02-02-2009, 10:09 PM
  5. Replies: 3
    Last Post: 13-12-2008, 12:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts