Nested Information (DataList + GridView) Question

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

  1. 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>
    , Sep 3, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nevyn Twyll
    Replies:
    8
    Views:
    1,847
  2. schapopa
    Replies:
    1
    Views:
    567
    schapopa
    Jan 12, 2006
  3. H5N1
    Replies:
    0
    Views:
    2,699
  4. H5N1
    Replies:
    1
    Views:
    4,487
  5. Les Caudle
    Replies:
    0
    Views:
    1,973
    Les Caudle
    May 2, 2006
Loading...

Share This Page