Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Assign people to different groups using asp.net mvc C#
gift
May 19 2015 11:00 AM
443
Reply
I want to assign people to different groups based on their scores, from a table called "people" to another table called "grouping" starting from the highest score. There are 80 people I want the first 20 candidates with the highest score assigned to “Group A”, the next 20 to ” Group B”, the next 20 to ” Group C” and so on. Am using asp.net MVC and C#
Database Name : peopleDB
Fields in people table
peopleID
Firstname
Lastname
scoresobtained
Grouping Table
Firstname
Lastname
group
In my Controller
public ActionResult autoassign()
{
var rc = new peopleDBEntities();
var res = (from p in rc.people
orderby p.scoresobtained descending
select new
{
firstname = p.firstname.ToString(),
lastname = p.lastname.ToString(),
score = f.canditatescores.ToString(),
});
in my controller as shown above, i have retrieved the values from people table from highest scores.(descending) how do iterate to pare them into groups of 20 each. i do not know how to go about it. so please help. I am using asp.net mvc in C#
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
datalist inside ajax popup extender.
Copying Map Information from One Biztalk project