Load XML to DataSet : DataSet : ADO.Net C# Examples


C# Examples » ADO.Net » DataSet »

 

Load XML to DataSet









    
using  System;
using  System.Data;
using  System.Data.SqlClient;

class  MainClass
{
    static  void  Main(string[]  args)
    {
        SqlConnection  MyConnection  =  new  SqlConnection("server=(local)\\SQLEXPRESS;database=MyDatabase;Integrated  Security=SSPI;");
        SqlDataAdapter  MyAdapter  =  new  SqlDataAdapter("SELECT  *  FROM  Employee",  MyConnection);
        DataSet  MyDataSet  =  new  DataSet();

        MyAdapter.Fill(MyDataSet,  "MyTable");
        MyDataSet.WriteXml(@"c:\Sample.xml");
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo ADO.Net
» DataSet