Join the Stack Overflow Community
Stack Overflow is a community of 6.8 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

i have two SqlDataSource one of them depends on a return value of the other how can i do this

<i><asp:SqlDataSource runat="server" ID="SqlDataSource2" ConnectionString='<%$ ConnectionStrings:mainConnectionString %>' SelectCommand="SELECT * FROM [schools]"></asp:SqlDataSource>

        <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString='<%$ ConnectionStrings:mainConnectionString %>' SelectCommand="SELECT * FROM [School_imgs] WHERE ([School_ID] = @School_ID)">
            <SelectParameters>
                <asp:Parameter Name="School_ID" Type="Int32"></asp:Parameter>
            </SelectParameters>
        </asp:SqlDataSource>"</i>
share|improve this question
    
Avoid SqlDataSource, instead work with ADO.NET directly. – Dai Dec 12 '16 at 7:31
    
SqlDataSource exists for quickly putting together simple CRUD operations for simplistic applications, it does not scale and is very inflexible, as you're seeing. – Dai Dec 12 '16 at 7:31
1  
Using SqlDataSource also means completely disregarding separation-of-concerns because you're mixing database query logic with presentation-tier view code. – Dai Dec 12 '16 at 7:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.