entity framework doesn't work as a datasource?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andy B

    entity framework doesn't work as a datasource?

    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 eternityrecords onlineEntities( )
    Repeater1.DataS ource = NewsContext.Get AllNews()

    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\M y Documents\Visua l Studio
    2008\Projects\T est\Test\Test\D efault.aspx Test

    Any idea why this is?



  • Andy B

    #2
    Re: entity framework doesn't work as a datasource?

    Ok. Fixed my own problem. the # was in the wrong spot.


    "Andy B" <a_borka@sbcglo bal.netwrote in message
    news:%238rR%23l ZQJHA.4008@TK2M SFTNGP02.phx.gb l...
    >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 eternityrecords onlineEntities( )
    Repeater1.DataS ource = NewsContext.Get AllNews()
    >
    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\M y Documents\Visua l Studio
    2008\Projects\T est\Test\Test\D efault.aspx Test
    >
    Any idea why this is?
    >
    >
    >

    Comment

    Working...