Queryable Vs. IEnumerable in terms of LINQ to SQL queries - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Saturday, June 11, 2011

Queryable Vs. IEnumerable in terms of LINQ to SQL queries

Few days ago I was working on my project which is having Linq to Sql as database layer. I got requirement to get the first of all employee who's designation starts with "soft".

I get fired below query and got the result in IEnumerable varible

  IEnumerable<employee> emp =          dc.Employees.Where(x => x.Desc.StartsWith("soft")); emp = emp.Take(1); 

But later on I found there it's taking too much time to get the count.
[Read the rest of this entry...]

No comments:

Post a Comment