J
Julien Sobrier
Hello,
I have 2 SqlDataSource on the same page that retrieve the same column names:
<asp:SqlDataSource ID="SqlStructure" runat="server"
SelectCommand="SELECT a, b FROM c WHERE d = 0 />
<asp:SqlDataSource ID="SqlSons" runat="server"
SelectCommand="SELECT a, b FROM c WHERE d = 74" />
The problem is that Eval("a") always return the value from SqlStructure.
I tried to change the query to "SELECT a AS x, b AS Y FROM c WHERE d =
74" but Eval("Y") returns an error.
The ultimate goal is to have something like this:
<asp:SqlDataSource ID="SqlStructure" runat="server"
SelectCommand="SELECT a, b FROM c WHERE d = 0 />
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlStructure" />
<ItemTemplate>
<h2><%# Eval("b")%></h2>
<asp:SqlDataSource ID="SqlStructure" runat="server"
SelectCommand="SELECT a AS X, b AS Y FROM c WHERE d = <%#
Eval('a') %> />
<asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlSons" />
<ItemTemplate>
<p><%# Eval("b AS Y")%></p>
<ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
Thank you
Julien
I have 2 SqlDataSource on the same page that retrieve the same column names:
<asp:SqlDataSource ID="SqlStructure" runat="server"
SelectCommand="SELECT a, b FROM c WHERE d = 0 />
<asp:SqlDataSource ID="SqlSons" runat="server"
SelectCommand="SELECT a, b FROM c WHERE d = 74" />
The problem is that Eval("a") always return the value from SqlStructure.
I tried to change the query to "SELECT a AS x, b AS Y FROM c WHERE d =
74" but Eval("Y") returns an error.
The ultimate goal is to have something like this:
<asp:SqlDataSource ID="SqlStructure" runat="server"
SelectCommand="SELECT a, b FROM c WHERE d = 0 />
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlStructure" />
<ItemTemplate>
<h2><%# Eval("b")%></h2>
<asp:SqlDataSource ID="SqlStructure" runat="server"
SelectCommand="SELECT a AS X, b AS Y FROM c WHERE d = <%#
Eval('a') %> />
<asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlSons" />
<ItemTemplate>
<p><%# Eval("b AS Y")%></p>
<ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
Thank you
Julien