예제 #1
0
 /// <summary>Create a new instance of the class.</summary>
 /// <param name="provider">
 ///     The <see cref="FileHelpers.Storage.DataStorageperforms the transformation.
 /// </param>
 public FileDataLink(DataStorage provider)
 {
     mProvider = provider;
     if (mProvider != null)
         mHelperEngine = new FileHelperEngine(mProvider.RecordType);
     else
         throw new ArgumentException("provider can´t be null", "provider");
 }
 /// <summary>Create a new instance of the class.</summary>
 /// <param name="provider">
 ///     The <see cref="FileHelpers.Storage.DataStorageperforms the transformation.
 /// </param>
 public ExcelDataLinkOleDb(DataStorage provider)
 {
     mProvider = provider;
     if (mProvider != null)
         mExcelStorage = new ExcelStorageOleDb(provider.RecordType);
     else
         throw new ArgumentException("provider can´t be null", "provider");
 }
예제 #3
0
        /// <summary>Create a new instance of the class.</summary>
        /// <param name="provider1">
        ///     The First <see cref="DataStorage" /> used to insert/extract records .
        /// </param>
        /// <param name="provider2">
        ///     The Second <see cref="DataStorage" /> used to insert/extract records .
        /// </param>
        public GenericDataLink(DataStorage provider1, DataStorage provider2)
        {
            if (provider1 == null)
                throw new ArgumentException("provider1 can´t be null", "provider1");
            else
                mDataStorage1 = provider1;

            if (provider2 == null)
                throw new ArgumentException("provider2 can´t be null", "provider2");
            else
                mDataStorage2 = provider2;

            ValidateRecordTypes();
        }
예제 #4
0
 /// <summary>The short way to Insert Records from a file to a DataStorage</summary>
 /// <param name="storage">The DataStorage where store the records.</param>
 /// <param name="filename">The file with the SourceRecords</param>
 /// <returns>The Inserted records</returns>
 public static object[] EasyInsertFromFile(DataStorage storage, string filename)
 {
     var link = new FileDataLink(storage);
     return link.InsertFromFile(filename);
 }
예제 #5
0
 /// <summary>The short way to Extract the records from a DataStorage to a file</summary>
 /// <param name="storage">The DataStorage from where get the records</param>
 /// <param name="filename">The file where to write the records to.</param>
 /// <returns>The Extracted records.</returns>
 public static object[] EasyExtractToFile(DataStorage storage, string filename)
 {
     var link = new FileDataLink(storage);
     return link.ExtractToFile(filename);
 }