Nested Information (DataList + GridView) Question

A

ammar_fake

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>
 

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,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top