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. Database & SysAdmin
  3. Database
  4. Reading SQL return messages from .NET

Reading SQL return messages from .NET

Scheduled Pinned Locked Moved Database
databasequestioncsharpperformance
2 Posts 2 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.
  • I Offline
    I Offline
    iammudman
    wrote on last edited by
    #1

    I'm trying to gather statistics from multiple queries to gauge our database performance. So, I dropped a "Set statistics io on" (with matching off) at the top of my query. In Sql Management Studio, the results of the query come back in the Results tab, while the IO statistics come back in the Messages tab. How can I gather the IO statistics (the messages) from .NET with the provided SQLCommand/SQLDataAdapter/etc. classes? I tried pausing my test app just after the query ran and looking through all the involved objects for the IO messages but couldn't find anything.

    S 1 Reply Last reply
    0
    • I iammudman

      I'm trying to gather statistics from multiple queries to gauge our database performance. So, I dropped a "Set statistics io on" (with matching off) at the top of my query. In Sql Management Studio, the results of the query come back in the Results tab, while the IO statistics come back in the Messages tab. How can I gather the IO statistics (the messages) from .NET with the provided SQLCommand/SQLDataAdapter/etc. classes? I tried pausing my test app just after the query ran and looking through all the involved objects for the IO messages but couldn't find anything.

      S Offline
      S Offline
      Scott Serl
      wrote on last edited by
      #2

      The SQLConnection object fires an InfoMessage event that you must catch.

      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