This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术讨论 / 这里有人用LINQ的吗?google了大半天一无所获,只能上来求教了。如何在用linq实现普通T-SQL的select * from Table1 where ID in s(s是字符串s1,s2,s3,...sn)?
-mfcguy();
2008-8-19
(#4628559@0)
-
你会用google吗? 看看 asp.net
-googlebot(bot);
2008-8-19
(#4628603@0)
-
it should look like this: Table1.Where(x=>s.Contains(x.ID)).ToArray() or .ToList()
-binghongcha76(一只大猫);
2008-8-20
(#4629131@0)
-
谢大猫,我试试去。
-mfcguy();
2008-8-20
(#4629206@0)
-
不谢不谢,我这几天也在钻研LINQ,深蓝的写法是传统LINQ,意思和我的一样,我用了Lamdar表达式。你们现在已经开始用.net 3.5开发项目了吗?
-binghongcha76(一只大猫);
2008-8-20
(#4629354@0)
-
嗯,经理坚持要用LINQ,我们只能follow,新东西总要用的,也不错,不过刚开始,所以很多东西要从新去research,进度比较慢。
-mfcguy();
2008-8-20
(#4629415@0)
-
不错,佩服你们经理,我们也刚刚把项目全部转成.net 3.5的了。给我的感觉,LINQ就像程序员的毒品,你一旦沾上,就永远放不下了,成倍成倍的提高编程的效率。
-binghongcha76(一只大猫);
2008-8-20
(#4629535@0)
-
Method approach + Lambda Expressions is more powerful than query approach. One advantage of the query approach is it looks closer to SQL query. And fortunately, sometimes, you can mix query with method like what I did.
-deep_blue(BLUE);
2008-8-20
(#4629555@0)
-
In LINQ, keyword ‘in’ is used for other purposes. So you cannot directly use it in filter condition.
-deep_blue(BLUE);
2008-8-20
{821}
(#4629203@0)
-
就等你回帖呢,谢谢深蓝:)。
-mfcguy();
2008-8-20
(#4629219@0)