For Loop for concatenation of strings
foreach (int id in ints)
{
idString.Append(id + ", ");
}
LINQ Query to concatenate a string
string ids = ints.Select(query => query.ToString()).Aggregate((a, b) => a + ", " + b);

Suthish NairPosted Oct 8, 2010, 10:11 AM
http://www.linqpad.net/WhyLINQBeatsSQL.aspx
Manikavelu VelayuthamPosted Oct 8, 2010, 2:17 AM
Ordinary For Loop doing the job in 1.4657 Milliseconds.
same job did through LINQ in 45.5678 Milliseconds.
I have done various test in LINQ like Aggreegate, Appending Strings, Filtering Rows - Everything seems to be slower in performance.
Now my question is What is the exact use or introducing LINQ concepts?
Suthish NairPosted Oct 8, 2010, 2:07 AM
You searched many websites?
The sample you given above seems same here too.
http://stackoverflow.com/questions/217805/using-linq-to-concatenate-strings
The site already have a good discussion about this.
Sam HobbsPosted Oct 7, 2010, 9:11 PM
Mike GoldPosted Oct 7, 2010, 9:44 AM
You can easily test this yourself.
1) Create a large enough test sample array
2) Put the following code before and after your code
DateTime start = DateTime.Now
;
// code here
DateTime end = DateTime.Now;
TimeSpan elapsedtime = end - start;
if this time is to coarse, use a hires timer http://msdn.microsoft.com/en-us/library/aa964692(VS.80).aspx