I've created the following Context
to be used with Entity Framework Code First:
public class Context : DbContext
{
public DbSet<Animal> Animals { get; set; }
}
Now I would like to use this Context
in an Asp.Net application to perform CRUD operations using a GridView
. I need to create a DataSource
to do the data binding. How would I go about?
The ASP part would look like this:
<asp:GridView runat="server" DataSourceID="animalDataSource" DataKeyNames="AnimalID" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="Description" HeaderText="Description" />
<asp:CommandField ShowCancelButton="true" ShowEditButton="true" ShowDeleteButton="true" />
</Columns>
</asp:GridView>
DBContext ObjectContext GridView
. the retagging didn't help tho :-\ – Medovich