TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Aditya Patil
NA
535
134.8k
URGENT: Sort by Group By in C# Console Application
Jul 14 2014 2:35 AM
List<Program> income = new List<Program>();
List<Program> incomeSorted = new List<Program>();
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?
Reply
Answers (
4
)
Sort by DateTime multidimentional array in C#
some help for my new project