Chapter 5 Efficiency?
This is probably the kind of question I would ask if I were taking this in a classroom. In DataGrid_sorting.aspx and DataGrid_paging.aspx, it seems awfully inefficient to have to requery the db and re-create the data adapter and the dataset each time the user clicks something on the page. Without having thought it all the way through at this point, it just seems on the face of it that it ought to be possible to make the connection object, the data adapter, and the dataset public objects that persist, so that the click event simply sets a new sort expression or new page index, and then re-binds the data. It seems to me that I've seen examples of this in other systems.
Is there a particular reason why this wouldn't work in ASP.NET?
Or is this topic addressed in more detail in subsequent chapters?
|