This is my method which gives me error.
public List GetProjectForCombo()
{
using (MyDataContext db = new MyDataContext (DBHelper.GetConnect
You cannot return anonymous types from a class... (Well, you can, but you have to cast them to object first and then use reflection at the other side to get the data out again) so you have to create a small class for the data to be contained within.
class ProjectNameAndId
{
public string Name { get; set; }
public string Id { get; set; }
}
Then in your LINQ statement:
select new ProjectNameAndId { Name = pro.ProjectName, Id = pro.ProjectId };