List
Console.WriteLine("Income");
Console.WriteLine("Predefined Category:");
for (i = 0; i < 2;i++)
{
for (j = 0; j < 2;j++)
{
Console.WriteLine("\n Predefined Category Selection: (Only Category ID.)");
icategory[i,j] = Console.ReadLine();
Console.WriteLine("\n Title:");
ititle[i,j] = Console.ReadLine();
Console.WriteLine("\n Amount:");
iamount[i,j] = int.Parse(Console.ReadLine());
Console.WriteLine("\n Date:");
idate[i, j] = DateTime.Parse(Console.ReadLine());
income.Add(new Program
{
icategory = icategory[i, j],
ititle = ititle[i, j],
iamount = iamount[i, j],
idate = idate[i, j],
});
}
}
Here by above code I took the data from User by array and added in List Income, Now I want to sort this Income list as below options
1. Sort by date
2. Sort by name
3. Group by category
Now how I can do that? can anyone give code in C# for this?


Pradeep ShetRank #595 · 4K reputationPosted Jul 13, 2014, 11:02 PM EDT
Aditya PatilRank #2,485 · 565 reputationPosted Jul 13, 2014, 11:04 PM EDT
in your code what is s? and what is use of it?
Can you also give me code for my problem, will be best.
Guest UserRank #259 · 9.8K reputationPosted Jul 13, 2014, 11:08 PM EDT
Pradeep's solution is right, and for lambda refer this nice blog at C#Corner by Sourav
http://www.c-sharpcorner.com/UploadFile/dacca2/lambda-expression-in-15-minutes/
thnx
twitter @sumitjolly
Aditya PatilRank #2,485 · 565 reputationPosted Jul 13, 2014, 11:10 PM EDT
Is linq and Lambda both are different things?
I will read it, but before that can you give me complete solution code for my problem.