//得到数据库中所有表的名字;
       string sql = " select   name   from   sysobjects   where   type='U'";
    //通过表名获取所有字段名;
         string sql = "Select name from syscolumns Where ID=OBJECT_ID('"+tableName+"')";
    //通过表名获取所有字段名和类型;
        select column_name,data_type from information_schema.columns where table_name = '表名'

相关文章: