Best way to display recordset data in gridview?
Posted on 2006-11-28
I am not new to web dev but new to .net and VS2005. I'm using VB.
I have the following data (SQL 2000) that I want to display:
For each ID in table 1 there will be several 'Headings' in table 2. I want each row in a gridview to display the date from table1 in one column and then in a second column I want to display all the headings in table 2 for the date displayed in column 1 (inner join on table1.ID = table2.table1ID). Each date should only display once with a vertical list of headings beside it.
If I just get the data in one SELECT query then it displays each heading in a new row with the date repeated for each one. Do I need to put a new gridview inside the second column (of the first gridview) to display each heading? But if I do that then I'm hitting the database with 2 separate queries, which doesn't sound like 'best practise'.
I'm interested to hear what you think is the best approach to this.
Thanks a lot,