示例#1
0
        //Список всех таблиц базы данных
        public static List <string> SqlTablesList(SqlProps props)
        {
            var list = new List <string>();

            using (var rec = new ReaderAdo(props, "SELECT * FROM sys.tables WHERE type_desc = 'USER_TABLE'"))
                while (rec.Read())
                {
                    list.Add(rec.GetString("Name"));
                }
            return(list);
        }
示例#2
0
 public BulkSql(SqlProps props, string tabl)
 {
     _tabl  = tabl;
     _props = props;
     //Получение списка колонок таблицы
     using (var rec = new ReaderAdo(props, "SELECT fld.name, fld.length FROM sysobjects tab, syscolumns fld WHERE tab.id=fld.id And tab.name='" + tabl + "'"))
     {
         int i = 0;
         while (rec.Read())
         {
             _cols.Add(rec.GetString("name"), i++);
             _colsSize.Add(rec.GetString("name"), rec.GetInt("length"));
         }
         _starter = new BulkStarter(_cols.Count, _table);
     }
 }