the case here is the number of columns i would like to store to the datatable depends on the number of available data. i would need a multiple select statements to collect all the data.
select test_result.stud_id,test_info.max_score,
test_result.test_score
from test_result left join test_info
on test_result.test_info_id = test_info.test_info_id
where test_info.test_type_id = 1 and test_info.test_num = 1;
i would have to repeat this code over and over again until the test_num reaches the current maximum count. i was thinking of looping this code while storing it to the datatable.this is what i would like the datagridview would display.
|Quiz Number | Quiz#1 | Quiz #2 | Quiz #3 | Quiz #4 | Quiz #5 |
|Max score | 20 | 25 | 30 | 15 | 15 |
|student 1 | 18 | 22 | 25 | 12 | 14 |
|student 2 | 19 | 20 | 25 | 11 | 13 |
|student 3 | 20 | 24 | 20 | 12 | 11 |
the display of data would be in rows. so each row would require a different select statement in order to display the required data.