Good day All, I need your help, I want to generate Position from a list of record for a particular user
- //I have a table Named Mark
- MarkID UserId SubjectName TotalScore
- 1 20 English 60.00
- 2 21 English 70.00
- 3 20 Maths 80.00
- 4 21 Maths 80.00
- // From the Table above i want to automatically generate Subject position for each each user in a gridview like this
- MarkID UserId SubjectName TotalScore Postition
- 1 20 English 60.00 2
- 3 20 Maths 80.00 1
- How do i automatically generate the subject position on it
- Normally this is what i have tried so far to get the list of a particular record
- var acc = from c in cdc.Marks where c.userId = "20" select c).tolist();
- gridview1.datasource = acc;
- gridview.datindind();
- //The above code only generate the student records and displays it on a gridview but automatically generating Position without is what i am looking for.. Please your help is really needed..
- Thanks in advance

Nitin SontakkeRank #264 · 9.6K reputationPosted Jul 4, 2016, 4:31 AM EDT
pius joshua31 reputationPosted Jul 4, 2016, 4:47 AM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Jul 5, 2016, 2:31 AM EDT
Vinay SinghRank #604 · 4K reputationPosted Jul 5, 2016, 2:35 AM EDT
Postition =i,
t.MarkID,
t.UserId ,
t.SubjectName,
t.TotalScore
});