1
我可以简单地通过LINQ的地方element.equals一个阵列
string myKeyword="test";
GridView1.DataSource = from e in table where e.Keyword.Equals(myKeyword) select e;
得到一个数组的一个项目我怎样才能把它扩展到一个数组中?我想是这样的:
string[] myKeywords={"test1", "test"};
GridView1.DataSource = from e in table where e.Keyword.Equals(myKeywords) select e; // something like this?
我想要得到的所有元素,其中的关键字等于关键字之一myKewords
看看这个:http://stackoverflow.com/questions/8043151/linq-in-operator – 2012-08-03 12:07:28