I am developing a method that looks for information in a very large table. Since I don’t use ORDER BY or anything special in the query (just SELECT id,description FROM complain WHERE description like 'YOUR TEXT HERE'" ), I was hoping to provide a more dynamic user interface by returning batches of results. This would be like doing query in Management Studio.
A few details, my call stack is small, but not all in one method. There buttonSearchClick , performCleanSearch and searchComplainBasedOnDetailInfo each of them is in a different layer (Interface, SearchBLL and SearchDAL, respectively).
I was thinking of creating an async method that populates something like List<Complain> , but that doesn't seem clean. I would have to make 3 layers asynchronous. Does anyone have any better ideas on how to implement this? Or is this the best way to do this?
Edit1: I managed to use SqlCommand.BeginExecuteReader along with Async processing in the connection string to get the query results as they appear ... now I need to figure out a way for my DAL method to be asynchronous, so the top level can get the results async too ... I I thought about implementing some kind of buffer ... maybe it’s the turn ...
Edit2: I am not looking for a paging solution or twitter similar to one (where you are viewing and viewing new results), because I know that the user will have to read all the information received ...
source share