Reading An XML File Into A Dataset : XML Database « Database ADO.net « C# / C Sharp






Reading An XML File Into A Dataset


/*
 * C# Programmers Pocket Consultant
 * Author: Gregory S. MacBeth
 * Email: gmacbeth@comporium.net
 * Create Date: June 27, 2003
 * Last Modified Date:
 * Version: 1
 */
using System;
using System.IO;
using System.Data;


namespace Client.Chapter_13___ADO.NET
{
    public class ReadingAnXMLFileIntoADataset
    {
        static void Main(string[] args)
        {
            string MyXMLDoc = @"<?xml version='1.0'>?
                            <title> MyExample</title>";
            StringReader MyStringReader = new StringReader(MyXMLDoc);
            DataSet MyDataSet = new DataSet();

            MyDataSet.ReadXml(MyStringReader);
        }
    }
}


           
       








Related examples in the same category

1.Fill data in DateSet to XmlDocument
2.Obtain an XML Document from a SQL Server Query
3.causes the the child rows to be nested within the parent rows in the output XML
4.illustrates how to write and read XML files
5.Persisting A Dataset To An XML File