public void ExcelMappingTest() { //IMcOleDbHelper helper = (IMcOleDbHelper)Activator.GetObject(typeof(IMcOleDbHelper), // ConfigurationManager.AppSettings["McOleDbServiceString"]); //DataSet dataSet = helper.ConvertExcelToDataSet("price.xls"); DataSet dataSet = ConvertExcelToDataSet("price.xls"); MappingEngine mapEngine = new MappingEngine(); mapEngine.MappingErrorEvent += ErrorHandler; MappingDocument mapDoc = MappingDocument.LoadFromFile("priceMapping.xml"); mapEngine.ProcessMapping(mapDoc, dataSet); }
public void MappingDataTest() { DataSet dataSet = LoadDataSetfromXML("DataSet.xsd", "DataSet.xml"); MappingEngine mapEngine = new MappingEngine(); string mapFileName = @"BookMapping.xml"; XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(mapFileName); MappingDocument mapDoc = MappingDocument.LoadFromXml(xmlDoc.OuterXml); mapEngine.ProcessMapping(mapDoc, dataSet); }