Hi
I am getting below error - Cannot implicitly convert type System.collection.generic.list
C#
BALStudents bALStudents = new BALStudents();
List Result = bALStudents.GetStudentBreakList();
namespace LMS.BAL
{
public class BALStudents
{
public List GetStudentBreakList()
{
List Result = (from t in context.StudentBreaks
where t.Active == true
orderby t.Name
select t).ToList();
return Result;
}
}
}Thanks

Ramco RamcoRank #462 · 5.4K reputationPosted Apr 5, 2023, 7:28 AM EDT
resolved.
Table Name & Form Name was same
Thanks
Jignesh KumarRank #91 · 22.9K reputationPosted Apr 5, 2023, 11:50 PM EDT
Hello Ramco,
Please try this one, you need to select and convert into new class,
public List GetStudentBreakList() { List Result = (from t in context.StudentBreaks where t.Active == true orderby t.Name select new StudentBreak { studentId = t.StudentId, //all other properties like this }).ToList(); return Result; }