forum

Home / DeveloperSection / Forums / cannot convert int to string

cannot convert int to string

Anonymous User 2400 05-Sep-2014
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?


c# c# 
Updated on 05-Sep-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By