LINQ(Language Integrated Query)语言集成查询是一组用于c#和Visual Basic语言的扩展。它允许编写C#或者Visual Basic代码以操作内存数据的方式,查询数据库。
Linq:各种数据源统一查找的查找方式,Objects,XML,DataSet,SQL.
1,form开头
2,在where后加筛选条件
3,select结尾
微软实例如下:
class LINQQueryExpressions
{
static void Main()
{
// Specify the data source.
int[] scores = new int[] { 97, 92, 81, 60 };
// Define the query expression.
IEnumerable<int> scoreQuery =
from score in scores
where score > 80
/* 升序操作 orderby score ascending */
/* 降序操作 orderby score descending */
select score;// Execute the query.
foreach (int i in scoreQuery)
{
Console.Write(i + " ");
}
}
}
// Output: 97 92 81
十个常用的查询标记学习http://www.cnblogs.com/knowledgesea/p/3897665.html