Описание тега entitydatasource
EntityDataSource is an ASP.NET web server control available in.NET Framework 3.5 SP1 or later.
EntityDataSource belongs to a family of server controls - like ObjectDataSource, SqlDataSource or XmlDataSource - which allow data-binding of web controls to a data source.
EntityDataSource is specifically tailored to interact with an Entity Data Model provided by Entity Framework. It supports declarative definition of CRUD operations in an ASPX web page as well as sorting, paging, data projections and various kinds of parameters to specify parametrized queries - like ControlParameter, QueryStringParameter, ProfileParameter and others.
Example
The following EntityDataSource configures data-binding to an Entity Data Model called "NorthwindEntitiesContext", selects an Order including all OrderDetails by an ID entered in a TextBox control and allows updating, inserting and deleting of Order objects:
<asp:EntityDataSource ID="NorthwindEntityDataSource" runat="server"
ConnectionString="name=NorthwindEntitiesContext"
DefaultContainerName="NorthwindEntitiesContext"
EntitySetName="Orders"
Include="OrderDetails"
EnableUpdate="True" EnableInsert="True" EnableDelete="True"
AutoGenerateWhereClause="True">
<WhereParameters>
<asp:ControlParameter Name="OrderID" ControlID="TextBoxOrderID"
DbType="Int32" PropertyName="Text" />
</WhereParameters>
</asp:EntityDataSource>
Resources