Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Not an asynchronous query(that just unblocks the calling thread) but an asynchronously *yielding* query

Not an asynchronous query(that just unblocks the calling thread) but an asynchronously *yielding* query

Scheduled Pinned Locked Moved C#
databasesql-servercsharpdesignsysadmin
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alaric_
    wrote on last edited by
    #1

    Ok..so create a table in SQL Server with a [varchar](50) primary key and insert 500,000 dummy rows into the table. Now, in SSMS, select all rows from that table and you will see results immediately display in the Results window while the query is still running. Opening an ADO.NET connection while awaiting an async reader will allow the thread to continue doing *different* work while the query runs, but I want to yield the results from my data layer to a UI layer as SQL Server prepares and marshals them. Does anyone have any working samples (technology agnostic) or any links they can direct me towards?

    "I need build Skynet. Plz send code"

    A 1 Reply Last reply
    0
    • A Alaric_

      Ok..so create a table in SQL Server with a [varchar](50) primary key and insert 500,000 dummy rows into the table. Now, in SSMS, select all rows from that table and you will see results immediately display in the Results window while the query is still running. Opening an ADO.NET connection while awaiting an async reader will allow the thread to continue doing *different* work while the query runs, but I want to yield the results from my data layer to a UI layer as SQL Server prepares and marshals them. Does anyone have any working samples (technology agnostic) or any links they can direct me towards?

      "I need build Skynet. Plz send code"

      A Offline
      A Offline
      Alaric_
      wrote on last edited by
      #2

      Figured it out. never mind.

      "I need build Skynet. Plz send code"

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups