I have a large dataset (over 100,000 records) that I want to load into a DataGridView. A stored procedure that does this can take 10 seconds or more.
So far, I have a BackgroundWorker that prevents user interface locking and has implemented a rudimentary "Please Wait" dialog.
What I would like to do is somehow populate the DataGridView with the results, as they are somehow coming back from the database. The best way to describe this — as SQL Server Management Studio does — when the query is executed, rows are returned immediately, even if the query is still running. There is also a button to stop the query and save the rows that were returned.
How can I do this in my own code?
A DataGridView is only used to display rows of data, and then the user clicks one to do something else. Nothing is returned to the database.
source
share