locked
Fetch Data from 2 table? RRS feed

  • Question

  • User-1305858305 posted

    Hello 

    Is it possible to retrieve from 2 tables at the same time?

    Bold letter explain what i need.

    <asp:SqlDataSource ID="sqlDataSourceGridView" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                SelectCommand="SELECT dia.*, Girdles.*, Shapes.*, Colors.*, ColorsLot.*, Cuts.*, Clarity.*, Polish.*, Sym.*, Fluo.*, Culet.*, Reports.*, Proportions.*, Categories.*           
                FROM Diamonds AS dia   //In here I need to fetch data from multiple diamonds table. Diamond1 Diamond2 Diamond3 etc      
                LEFT JOIN Shapes ON Shapes.ShapeID = dia.ShapeID             
               ....
                ORDER BY dia.DateAdd DESC"
                OnSelecting="sqlDataSourceGridView_Selecting">
                <SelectParameters>
                    <asp:Parameter Name="Category" DefaultValue="2" />
                    <asp:Parameter Name="Status" DefaultValue="2" />
                    <asp:Parameter Name="Function" DefaultValue="1" />
                    <asp:Parameter Name="Operation" DefaultValue="0" />
                    <asp:Parameter Name="ReportIDs" />
                    <asp:Parameter Name="ShapeIDs"/>                           
                </SelectParameters>
            </asp:SqlDataSource>

    Saturday, January 10, 2015 12:23 PM

Answers

  • User197322208 posted

    create a view that join the tables and retrieve data from the view

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, January 10, 2015 1:48 PM

All replies