Skip to content

GridView

Aditi

Asked Mar 7, 2012, 12:05 AM EST1 answer
Share
LinkedInX
How to add different columns from different tables in grid view of ASP.NET using c#?

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    I think you should have done these selected column from different tables in query to come up with a signle table and view in page.

    Ex:

            SQL Query

            SELECT          a.Col1, b.Col2, c.Col1, d.Col5
            FROM           Table1 a
            INNER JOIN    Table2 b
            ON         a.ID = b.ID
            INNER JOIN    Table3 c
            ON         a.ID = c.ID
            INNER JOIN    Table4 c
            ON         a.ID = d.ID

    the result of this query is a single table with columns from different tables that conforms to the "JOIN CONDITION". This result can now be viewed in a datagrid
    0