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. SQL Server connection sharing

SQL Server connection sharing

Scheduled Pinned Locked Moved Database
databasesql-serverwpfcomsysadmin
3 Posts 3 Posters 6 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.
  • N Offline
    N Offline
    Nick Blumhardt
    wrote on last edited by
    #1

    Hi everyone :) I'm not sure if this is possible, but I was wondering if there was a way for two threads to concurrently (and reasonably independently) share an SQL Server connection, such as the OLE DB templates CDataSource object? Presently, my attempts have been serialised internally by SQL Server, so that the net effect is that one of the requests must complete before the other can begin... thanks to anyone who can offer some pointers! nb

    R 1 Reply Last reply
    0
    • N Nick Blumhardt

      Hi everyone :) I'm not sure if this is possible, but I was wondering if there was a way for two threads to concurrently (and reasonably independently) share an SQL Server connection, such as the OLE DB templates CDataSource object? Presently, my attempts have been serialised internally by SQL Server, so that the net effect is that one of the requests must complete before the other can begin... thanks to anyone who can offer some pointers! nb

      R Offline
      R Offline
      Rashid Thadha
      wrote on last edited by
      #2

      One possible way of implementing this is to use ADO and ADO Events. Basically you execute a SQl statement and once the statement has been executed, you will recieve an EVENT that the execution has completed. This will allow you to run your second sql statement. knowing the first one has finished. see the following for example http://msdn.microsoft.com/library/default.asp?url=/library/en- us/ado270/htm/mdevteventmodelxvc.asp

      L 1 Reply Last reply
      0
      • R Rashid Thadha

        One possible way of implementing this is to use ADO and ADO Events. Basically you execute a SQl statement and once the statement has been executed, you will recieve an EVENT that the execution has completed. This will allow you to run your second sql statement. knowing the first one has finished. see the following for example http://msdn.microsoft.com/library/default.asp?url=/library/en- us/ado270/htm/mdevteventmodelxvc.asp

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        thanks Rashid, I'll give it a shot.

        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