public void GeneralLoadTestExcel() { ConnectToExcelConfiguration configuration = new ConnectToExcelConfiguration(); configuration.FilePath = @"TestData\LoadFromExcel\TestData.xlsx"; configuration.SheetName = "Contacts"; IConnection excelConnection = new ConnectToExcel() { Configuration = configuration }; IDataSource loadFromExcel = new LoadFromExcel(); IDatastore dataObject = DataStoreFactory.GetDatastore(); loadFromExcel.LoadData(excelConnection, dataObject, ReportProgressMethod); }
public static IDatastore LoadExcelsheet(string sheetPath, string sheetName) { ConnectToExcelConfiguration configuration = new ConnectToExcelConfiguration(); configuration.FilePath = sheetPath; configuration.SheetName = sheetName; IConnection excelConnection = new ConnectToExcel() { Configuration = configuration }; IDataSource loadFromExcel = new LoadFromExcel(); IDatastore dataStore = DataStoreFactory.GetDatastore(); loadFromExcel.LoadData(excelConnection, dataStore, ReportProgressMethod); return(dataStore); }