I am currently working on a project where I need to read a table from my SQL server and load it into a table on the web page on page load.
I currently can think of two ways to implement this:
- On the Page_Load() call, read from the database and dynamically construct the table.
- Use an SQL Data Source object to read it in and then display it using a GridView
I can't think of other options, but from experience with both, they both seem to really take a toll on the runtime. On my current PC, it doesn't seem to be an issue due to its high specs. But when I try running it on other PCs at work, it takes a while for the page to load.
Ideally, I want to be able to do this quickly to improve the user experience. And I can't just put the data in manually because my boss wants it to read from the database for easier management and updating.
So, which of the two ways to implement it is faster and/or better design-wise? If there is another option, what is it? I've been personally learning front-end and back-end stuff informally since I started this project.