Пример #1
0
        System.Data.DataSet IFileConverter.Import(string filename)
        {
            switch (Options.ImportEngine)
            {
            case DBFEngine.OLEDB:
            {
                string connectionString = ConnectionStringManager.MakeDBF(filename, true);
                string tablename        = Path.GetFileNameWithoutExtension(filename);
                return(Common.OleDbTables(connectionString, tablename, QueryFilter.Exact));
            }

            case DBFEngine.DBF4:
            {
                var dbf = new dBase4(Options);
                dbf.OpenFile(filename);
                return(DataUtil.ToDataSet(dbf.DataTable));
            }

            default:
                throw new ArgumentOutOfRangeException("ImportEngine=" + Options.ImportEngine);
            }
        }