I am working with an sql server database and entity framework (version 6).
Look at this code behind code:
public partial class WebForm1 : System.Web.UI.Page
{
private bdd1Entities bdd = new bdd1Entities();
protected void Page_Load(object sender, EventArgs e)
{
Repeater1.DataSource = bdd.Personnes.ToList();
Repeater1.DataBind();
}
}
And here is the repeater source in aspx page:
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container.DataItem, "Nom") %></td>
</tr>
</ItemTemplate>
</asp:Repeater>
It works fine but if I remove the ToList() function call in code behind, I got
this exception: System.NotSupportedException
I do not understand why. I just want to understand thanks