Load From XML

  • Thread starter Thread starter MikeB
  • Start date Start date
M

MikeB

Hello all, what is the best / most efficaiant way to load data from XML into
a sqlce database? Here is what I am using to create the XML:

//Create Main Dataset
DataSet dsMain = new DataSet();

//Create Dataset to hold all DB Tables
DataSet dsTables = new DataSet();
myApp.Classes.Globals.gDB.LoadDataset("SELECT table_name FROM
information_schema.tables WHERE table_type = 'TABLE'",dsTables);

foreach(System.Data.DataRow dr in dsTables.Tables[0].Rows )
{
myApp.Classes.Globals.gDB.LoadDataset("SELECT * FROM " +
dr["table_name"].ToString(),dr["table_name"].ToString(),dsMain);
}

//Export to XML
dsMain.WriteXml(@"\SDMMC Disk\\DBBackUp.xml");
 
Back
Top