Nested Information (DataList + GridView) Question

Discussion in 'ASP .Net' started by ammar_fake, Sep 3, 2006.

  1. ammar_fake

    ammar_fake Guest

    Hello there.

    I need a DataList to render the Gridview by providing one of the
    DataList values as a query for the underlaying Gridview.

    This does not work:

    SelectCommand="select * from projects where emp_id = <%# Eval("EMP_ID")
    %>"

    This is my code (simplified):

    <asp:SqlDataSource
    ID="SQLDSEmp"
    SelectCommand="select * from employees"
    ...
    />

    <ASP:DataList
    ID="DataListEmp"
    DataSourceID="SQLDSEmp"
    <ItemTemplate>
    <asp:Label ID="titleLabel" Text='<%# Eval("EMP_NAME") %>'/>

    <asp:GridView
    DataSourceID="OrderDetailsDataSource"
    AutoGenerateColumns="False" />

    <asp:SqlDataSource
    ID="OrderDetailsDataSource"
    SelectCommand="select * from projects where
    emp_id = <%# Eval("EMP_ID") %>">
    </asp:SqlDataSource>
    </ItemTemplate>
    </ASP:DataList>
     
    ammar_fake, Sep 3, 2006
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.