Esempio n. 1
0
        public void OrdersRead1()
        {
            ExcelStorageOleDb provider = new ExcelStorageOleDb(typeof(OrdersExcelType), 1, 1);

            provider.FileName = @"..\data\Excel\Orders.xls";
            object[] res = provider.ExtractRecords();

            Assert.AreEqual(830, res.Length);
        }
Esempio n. 2
0
        public void OneColumn()
        {
            ExcelStorageOleDb provider = new ExcelStorageOleDb(typeof(OneColumnType), 1, 1);

            provider.FileName = @"..\data\Excel\OneColumn.xls";

            object[] res = provider.ExtractRecords();

            Assert.AreEqual(50, res.Length);
        }
 /// <summary>
 ///     Extract records from a file and insert them to the data source using the DataLinkProvider
 ///     <see
 ///         cref="FileHelpers.Storage.DataStorageds" />
 ///     method.
 /// </summary>
 /// <param name="excelFileName">The file with the source records.</param>
 /// <returns>True if the operation is successful. False otherwise.</returns>
 public bool InsertFromExcel(string excelFileName)
 {
     mLastInsertedRecords = mExcelStorage.ExtractRecords();
     mProvider.InsertRecords(mLastInsertedRecords);
     return(true);
 }