Users Pricing

forum

Home Forums cannot convert int to string – MindStick

cannot convert int to string

Anonymous User 2785 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?


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md