New to EF. I'm trying to bind the results of a linq query to a drop down list. Here's the code:
public partial class createDoc : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
HCLEntities Context = new HCLEntities();
var query = from p in Context.Equipments
projectDropDownList.DataSource = query;
When the code is executed, I get the following message:
Data binding directly to a store query is not supported. Instead populate a DBSet with data, for example by calling Load on the DBSet, and then bind to local data.
Not sure how to fix the error. Suggestions would be greatly appreciated.