var query = from s in student
select new ListItem
{
ID = s.studentId,
Name = s.studentName
};
When I tried to execute the code I got the error
//Cannot implicitly convert type 'int' (studentId) to 'string' (ID).
Is there anyway I can achieve this?
.ToString()ContactIdreferenced anywhere, and unlessListItemnot theListItemI think it is, it should benew ListItem { Value = s.studentId.ToString(), Text = s.studentName }