I'm developing a method that searches for info in a very large table. Since I don't use ORDER BY
or anything special in the query (just a simple SELECT id,description FROM complain WHERE description like 'YOUR TEXT HERE'"
), I was hoping to provide a more dynamic user experience by returning batches of results. This would be something similar to running a query in Management Studio.
A few details, my call stack is not large, but not everything is in the same method. There's buttonSearchClick
, performCleanSearch
and searchComplainBasedOnDetailInfo
each of those in a different layer (Interface, SearchBLL and SearchDAL respectively).
I thought about creating an async method that fills something like a List<Complain>
but that doesn't seem as clean. I would have to make 3 layers of async. Does anyone have any better ideas on how to implement this? Or is this the best way to do it?
Edit1: I've managed to use SqlCommand.BeginExecuteReader along to Async Processing on the connection string to fetch the results from the query as they appear... now i have to figure out a way to make my DAL method be async so the upper layer can fetch the results also async... i was thinking in implementing a buffer of some kind... maybe a queue...
Edit2: I'm not looking for a paging solution or twitter like one (where you scroll and new results are searched) because I know for a fact that the user will have to read all the information im fetching...