Use lambda with Ado.Net

Asked

Viewed 147 times

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?

2 answers

1

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

You are not signed in. Login or sign up in order to post.