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?
Home / DeveloperSection / Forums / cannot convert int to string
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?
Sumit Kesarwani
05-Sep-2014