c# .net

How to fill a combox in windows application using entity framework c# .net?

How to fill a combox in windows application using entity framework c# .net? , someone asked me to explain?

In this example, I will show you how to fill a combox in windows application using entity framework c# .net.

  private void LoadCountries()
        {
            var countries = (from c in db.Orders
                             select new { c.ShipCountry }).Distinct().ToList();
           cboCountry.DataSource = countries;
           cboCountry.ValueMember = "shipcountry";
           cboCountry.DisplayMember = "shipcountry";
       }

Output:

fill combo box in windows application c# .net

Post your comments / questions