I want to use multiple queries in one list view.In my list view each column values have to be derived from more than two tables.So how cal I use multiple queries in the list view.
my asp.net code;
<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>
You could use a UNION statement and join the two results together, the data types for each column needs to be the same so you may need to pad one query with extra columns to match the other.