HI, I tried to show list of name on cmbobox this is the code(query var query = (from p in dbhome.Stores select new { p.FNameware,p.id }).ToList(); Cbox.DataSource = query.ToList();
Using the Northwind Database Customers Entity. I gave created the following sample
public partial class Form1 : Form { public Form1() { InitializeComponent(); NorthwindEntities entities = new NorthwindEntities(); cmbCustomers.DataSource = (from customer in entities.Customers where customer.City == "London" select customer); cmbCustomers.DisplayMember = "ContactName"; cmbCustomers.ValueMember = "CustomerId"; } }
© COPYRIGHT 2024 ASPSnippets.com ALL RIGHTS RESERVED.