How to Solve this Error "Cannot convert lambda expression to type 'string' because it is not a deleg

Posted by peace on Stack Overflow See other posts from Stack Overflow or by peace
Published on 2010-06-12T21:45:56Z Indexed on 2010/06/12 22:03 UTC
Read the original article Hit count: 231

Filed under:
|
|
|
|

. I get this error: "Cannot convert lambda expression to type 'string' because it is not a delegate type" - keyword select become underlined in blue Can you please advice.

   Employee emp = new Employee();
   comHandledBySQt.DataSource = from x in emp.GetDataFromTable("1")
                    select new { x.Id, Name = x.FirstName + " " + x.LastName };
   comHandledBySQt.DisplayMember = "Name";
   comHandledBySQt.ValueMember = "Id";

Above code should displays drop list of employees first name and last name in a combo box

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET