NorthwindEntities db = new NorthwindEntities();
var customers = from c in db.Customers
select new
{
c.CustomerID,
c.CompanyName
};
SelectList customersList = new SelectList(customers.Take(10), "CustomerID", "CompanyName");
ViewData["DdlCustomers"] = customersList;
No comments:
Post a Comment