Recently I was using resharper to refactor some of my code and found that it was suggesting to use any() extension method instead of count() method in List<T>. I was really keen about performance and found that resharper was right. There is huge performance difference between any() and count() if you are using count() just to check whether list is empty or not.
In Count() method code will traverse all the list and get total number of objects in list while in Any() will return after examining first element in the sequence. So in list where we have many object it will be significant execution time if we use count().
Friday, January 18, 2013
How to get N row from datatable in C#
Problem:
Possible Solutions to problem:
- With normal for loop
- With lamda expression and linq
1. With normal for loop:
Following is code from where we can get 3 rows of data table.Thursday, January 17, 2013
New Milestone for Dotnetjalps.com-500000 visits for my blog
Today I got great news from sitemeter.com that my blog http://www.dotnetjalps.com completed 500,000 visitors for my blog. This is a new milestone achieved for this blog and I would like to thank all my blog readers for making this blog this much bigger.
On this occasion I would like to thanks all supporters, friends and my family members who have faith in me and believe that I could do something and this all because of them and my blog readers.
Followings are my statistics for my blog.
On this occasion I would like to thanks all supporters, friends and my family members who have faith in me and believe that I could do something and this all because of them and my blog readers.
Followings are my statistics for my blog.