Last post Feb 02, 2012 08:02 PM by Decker Dong - MSFT
Feb 01, 2012 02:14 AM|hyder92|LINK
i dont wont to give EntityName on aspx page and i want to fill data in EntityDataSource on its event like OnSelecting
<asp:EntityDataSource ID="EntityDataSource_AllMembers" runat="server" ConnectionString="name=HunchClub_db"
DefaultContainerName="HunchClub_db" OrderBy="it.ID" EntitySetName="UserProfiles"
can any one help me how can i dynamic fill EntityDataSource Object and Than Assing to Grid
Feb 02, 2012 08:02 PM|Decker Dong - MSFT|LINK
There are mainly two ways——
1）You can handle the EntityFramework's Selecting event，and do a query with the help of LINQ-TO-ENEITY and assign to fetch all the data contents。See sample at：
protected void BlogDataSource_Selecting(object sender, EntityDataSourceSelectingEventArgs e)
e.DataSource.Select="Your select statement";
2）The most fixible way is that you can get rid of EntityDataSource and then do binding to the GridView directly by setting DataSource and call DataBind()。