1,linq 中合并集合
static void Main(string[] args) { List<int> a = new List<int> { 1, 2 }; List<int> b = new List<int> { 2, 3 }; List<int> c = a.Union(b).ToList(); foreach (int i in c) Console.WriteLine(i); //1 2 3 Console.ReadLine(); }2,
要知道一个数据库里共有多少个用户表:
select count(*) from sysobjects where type='U'
完整输出语句为(下同):
Response.Write conn.execute("select count(*) from sysobjects where type='U'")(0)
要知道一个数据库里总共有多少个用户表的字段:
select sum(info) from sysobjects where type='U'
要知道一个数据表有多少个字段:
select count(*) from syscolumns where id = object_id('表名')
经查得棍客网现在共有93个数据表,近1000个字段,不久后肯定会超过1000。

本文详细介绍了如何使用LINQ进行集合合并,并通过SQL查询获取数据库中用户表的数量及字段信息。实例展示了从两个集合中创建唯一元素集合的方法,并通过执行SQL语句查询数据库表数量和字段总数。
1万+

被折叠的 条评论
为什么被折叠?



