c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
c# .net

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

| | CSharp

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: