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;
Showing posts with label SelectList. Show all posts
Showing posts with label SelectList. Show all posts
Thursday, October 21, 2010
populate SelectList with linq to sql results
Subscribe to:
Posts (Atom)