Click here to Skip to main content
15,888,600 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
var E = (from em in employee.Employees
                    orderby em.EmployeeID
                    //where em.EmployeeID==1
                    select new {  Names= em.FirstName,ID=em.EmployeeID  }).ToList();
           
          
           
           comboBox1.DisplayMember = " Names";
           comboBox1.ValueMember = "ID";
           comboBox1.DataSource = E ;

// its my code but comboBox don't fill like i want can any one help me ?
Posted

If you've literally copied and pasted the code, you have a space before the N in Names.
 
Share this answer
 
no it's not my problem my problem is the combobox dispaly ID and Name in combobox and i want dispaly Name only and the value is ID how?
 
Share this answer
 
Comments
Nelek 25-Mar-14 19:25pm    
Please don't post solutions to chat with people, if you want to speak directly to someone use the "have a question or Comment?" or the tiny "reply" button in a comment. The meesages are not always sorted by date, so it can be very difficult to follow the "conversation". Another advantage is, that the person you write a comment to will receive a notification about the message

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900