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?

Aditya PatilPosted Jul 14, 2014, 3:10 AM
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.
Guest UserPosted Jul 14, 2014, 3:08 AM
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 PatilPosted Jul 14, 2014, 3:04 AM
in your code what is s? and what is use of it?
Can you also give me code for my problem, will be best.
Pradeep ShetPosted Jul 14, 2014, 3:02 AM