1

With ADO.net I only know how to display results once the entire result set has returned, but SSMS seems to be able to start displaying results while they are still being fetched in many cases.

How does it do that?

Apologies if this question has been asked before... seems like it would have been but I didn't see it.

6
  • 4
    In ADO.Net, Readers are streams. You can interact with a result before it is completely streamed to you, you just didn't realize it. (not the voter)
    – Crowcoder
    Aug 29, 2016 at 19:16
  • Ahhh... yeah I feel kind of silly now. I knew that I could use BeginExecuteReader() to allow my application to continue processing as the results were being returned but totally didn't think about the fact that I can immediately access the stream. Thanks! Feel free to post that as an answer for some easy points :)
    – BVernon
    Aug 29, 2016 at 19:26
  • Exactly my question, but I am not as smart as you guys. BeginExecuteReader(SomCallback, com) does not block my UI but the callback is only called once, after the query has ended. What am I missing?
    – Jan
    Mar 5, 2018 at 13:16
  • @Jan Sorry I would answer if I had time but you will probably be better off just posting a new question asking how to access the stream.
    – BVernon
    Mar 5, 2018 at 17:15
  • Thx, I already got it to work! (and maybe I'll leave an answer later), the problem on my side was the sql command text, it could not give back rows until it was finished executing. -.- ^^
    – Jan
    Mar 6, 2018 at 12:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.