I have a table with records that has 5 fields. how can i get all the values of just one field using linq statment.
Thank you in advance
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Yadlapalli SrikanthRank #7,940 · 231 reputationPosted Sep 17, 2015, 1:14 AM EDT
class ProjectInfo
{
public string Name {get; set; }
}
public List GetProjectForCombo()
{
using (MyDataContext db = new MyDataContext (DBHelper.GetConnectionString()))
{
var query = from pro in db.Projects
select new ProjectInfo(){ Name = pro.ProjectName};
return query.ToList();
}
}