best way to display resultset?

  • Thread starter Thread starter Augustin Prasanna
  • Start date Start date
A

Augustin Prasanna

I need to display some 200 records (dynamic) on the screen..

I need to display records from 2 tables (one to many relationship)

output would look like


Customer Id Name Phone NO
1 abc 23949495
34945959

2 xyz 39595699

3 fhg 34858686
34585689

This will be a read only grid.


which is the best approach?

1) use datareader or dataset to get the data from database.
2) use server controls like datagrid/datalist/data repeater or generate html
table dynamically?

can you discuss the pros and cons of each of these?

I am not sure how the phone no part (from a diff resultset) be implemented..

one way, i can think of is,, iterate thru first resultset and generate html
table and for each row, query the second resultset and display the relevant
contents. is there any other better way?

Regards,
Augustin
 
Why cant you join the data in the SQL so that you have one dataset? It is
likely to be a simple enough statement.

With a single dataset it will be about 10 lines of code to obtain the
dataset, bind to a datgrid and implement pagination (or probably none if you
use visual studio's designer).

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
 
Back
Top