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. error in sql server 2008

error in sql server 2008

Scheduled Pinned Locked Moved Database
databasesql-serversysadmintoolshelp
6 Posts 4 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.
  • J Offline
    J Offline
    jojoba2011
    wrote on last edited by
    #1

    when i wanna to get script from my DB in sql server management 2008 i get this error : There is already an open DataReader associated with this Command which must be closed first.....what is meann of this error note : 1.even i stop start the instance. 2.copy the DB to other system also but same error ! thanks in advnaced !

    M Richard DeemingR J 3 Replies Last reply
    0
    • J jojoba2011

      when i wanna to get script from my DB in sql server management 2008 i get this error : There is already an open DataReader associated with this Command which must be closed first.....what is meann of this error note : 1.even i stop start the instance. 2.copy the DB to other system also but same error ! thanks in advnaced !

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      This is not a sql error, it is in your code. You are opening a second connection before closing the first connection either using async calls or creating a new instance of your DAL class.

      Never underestimate the power of human stupidity RAH

      Richard DeemingR 1 Reply Last reply
      0
      • M Mycroft Holmes

        This is not a sql error, it is in your code. You are opening a second connection before closing the first connection either using async calls or creating a new instance of your DAL class.

        Never underestimate the power of human stupidity RAH

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        Mycroft Holmes wrote:

        You are opening a second connection before closing the first connection

        A second connection wouldn't cause a problem. It's opening a second DataReader on the same connection which causes this error.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        1 Reply Last reply
        0
        • J jojoba2011

          when i wanna to get script from my DB in sql server management 2008 i get this error : There is already an open DataReader associated with this Command which must be closed first.....what is meann of this error note : 1.even i stop start the instance. 2.copy the DB to other system also but same error ! thanks in advnaced !

          Richard DeemingR Offline
          Richard DeemingR Offline
          Richard Deeming
          wrote on last edited by
          #4

          You are trying to open two DataReader instances (by calling ExecuteReader) on the same connection at the same time. You need to make sure that every DataReader is closed properly by wrapping it in a using block, and that you close one before trying to open another.


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

          J 1 Reply Last reply
          0
          • Richard DeemingR Richard Deeming

            You are trying to open two DataReader instances (by calling ExecuteReader) on the same connection at the same time. You need to make sure that every DataReader is closed properly by wrapping it in a using block, and that you close one before trying to open another.


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            J Offline
            J Offline
            Jorgen Andersson
            wrote on last edited by
            #5

            You can if you're using multiple Active Result Sets[^] on an SQLServer, and on Oracle you can anyway[^].

            Politicians are always realistically manoeuvering for the next election. They are obsolete as fundamental problem-solvers. Buckminster Fuller

            1 Reply Last reply
            0
            • J jojoba2011

              when i wanna to get script from my DB in sql server management 2008 i get this error : There is already an open DataReader associated with this Command which must be closed first.....what is meann of this error note : 1.even i stop start the instance. 2.copy the DB to other system also but same error ! thanks in advnaced !

              J Offline
              J Offline
              jojoba2011
              wrote on last edited by
              #6

              One of my Stored Procedures was using ۀ in its name and when i am getting script it was giving error!

              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