entity framework doesn't work as a datasource?

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top