根据自己的须求写个吧,一般我用自己写的就是生成实体类和DAL的基本增删改查。
string sqlstr = "select c.name, t.name as type, c.length,(select value from sys.extended_properties where major_id=c.id and minor_id=c.colid) as shuoming from syscolumns c join systypes t on c.xtype=t.xtype where t.name <> 'sysname' and c.id=object_id('" + tablename + "') order by c.colid asc";