entity framework doesn't work as a datasource?

  • Thread starter Thread starter Andy B
  • Start date Start date
A

Andy B

I have the following code and can't quite figure out why it doesn't work. in
the first section, I am trying to take the data from a entity framework
function import and use it inside a repeater.

<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<% #Bind("Title") %>
</ItemTemplate>
</asp:Repeater>

In this section of code, I have the code that creates the entity context and
(I think) runs the function GetAllNews and binds it to the repeater control.
This doesn't seem to work for some reason.

Dim NewsContext As New eternityrecordsonlineEntities()
Repeater1.DataSource = NewsContext.GetAllNews()

I get this error from vs2008 when I am in the markup of the page:
Error 1 'If', 'ElseIf', 'Else', 'End If', 'Const', or 'Region' expected.
C:\Documents and Settings\Andy\My Documents\Visual Studio
2008\Projects\Test\Test\Test\Default.aspx Test

Any idea why this is?
 
Back
Top