1
Using sqldatareader and ado.net, can you use lambda with Linq or just lambda or just Linq? This is not a multiple question, but Lynx and Lambda are always together, so the various "?" okay?
1
Using sqldatareader and ado.net, can you use lambda with Linq or just lambda or just Linq? This is not a multiple question, but Lynx and Lambda are always together, so the various "?" okay?
1
Yes
What you call "lambda" is actually a parameter of the type Func<TSource, T>
, which is a predicate. It does not coexist with the Linnum, as you can see by this link:
http://msdn.microsoft.com/pt-br/library/bb534803(v=vs.110). aspx
In the same way as the Linnum not necessarily need to use predicates to work, as examples of the link below:
1
I have very little experience with sqldatareader but contextualizing...
The ADO.NET is a set of classes that expose data access services to . NET Framework developers. The results of data manipulation are processed, placed on an object Dataset ADO.NET to be exposed to the user.
The LINQ (Language-Integrated Query) allows developers to form joint-based queries in their application code, without needing to use a separate query language, such as using SQL in C#. But the LINQ works with Ienumerable type data sources.
You can use all these options, both Inline and lambda with ado.net:
One option, which I think is interesting to you, would be to implement an extension method that would return a Ienumerable to iterate over your Reader’s Rows. In this post there is an example: http://www.thinqlinq.com/Default/Consuming_a_DataReader_with_LINQ.aspx
Another option is to use LINQ to Dataset, which converts data from your object collections into Ienumerable-based collections.
About the use of lambda I found this example too, but I don’t know if it’s exactly what you want: http://mvcbricks.blogspot.com.br/2009/08/c-30-lambda-expressions-in-charge-of.html
Browser other questions tagged c# linq lambda-expressions ado.net
You are not signed in. Login or sign up in order to post.