我想在一个列表视图中使用多个查询。在我的列表视图中,每一列的值都必须来自两个以上的表。那么我如何在列表视图中使用多个查询。
我的 asp.net 代码;
<LayoutTemplate>
<table id="Table1" border="2" cellspacing="3" cellpadding="3" style="color: Black; border-bottom:1px solid black; border-right:1px solid black; border: thin solid #000000;" runat="server" >
<tr id="Tr1" runat="server">
<td id="Td1" runat="server">Owned By </td>
<td id="Td2" runat="server">Shared class </td>
<td id="Td3" runat="server">Effective Interest </td>
<td id="Td4" runat="server">Deemed Interest </td>
<td id="Td5" runat="server">Shares Owned </td>
<td id="Td12" runat="server">Shares Issued </td>
</tr>
<tr style="border-style: 1; border-color: #FFFFFF!important; border-width: 1px; color: #FF0000;">
<td><%#Eval("owner_CompanyId")%> </td>
<td><%#Eval("owner_sharetype")%> </td>
<td><%#Eval("owner_effectinterest")%> </td>
<td><%#Eval("owner_effectinterest")%> </td>
<td><%#Eval("owner_shares")%> </td>
</tr>
<tr id="ItemPlaceholder" runat="server">
</tr>
</table>
<table>
<tr style="border-style: 1; border-color: #FFFFFF!important; border-width: 1px; color: #FF0000;">
here i want to use the data from another tables with different queries
<td><%#Eval("comp_CompanyId")%> </td>
<td><%#Eval("ownercompanylog_sharetype")%> </td>
<td><%#Eval("owner_effectinterest")%> </td>
<td><%#Eval("owner_effectinterest")%> </td>
<td><%#Eval("owner_shares")%> </td>
</tr>
</table>
</LayoutTemplate>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:DreamsConnectionString4 %>"
SelectCommand="SELECT [owner_CompanyId], [owner_childcompid], [owner_effectinterest], [owner_sharetype], [owner_shares] FROM [Owner] WHERE ([owner_CompanyId] = @owner_CompanyId)"
OnSelecting="SqlDataSource1_Selecting" >
<SelectParameters>
<asp:ControlParameter ControlID="HiddenField1" DefaultValue="18"
Name="owner_CompanyId" PropertyName="Value" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>