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. Web Development
  3. ASP.NET
  4. Reader not opening a second time

Reader not opening a second time

Scheduled Pinned Locked Moved ASP.NET
helpdatabasetutorialquestion
5 Posts 3 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
    jamesbronw
    wrote on last edited by
    #1

    Hi, I have a wep page that reads from a database in order to get background colors for certain buttons on the page. It works fine when you go to the page and when there is a postback event. When i navigate away from the page and try to go back to it i get an error message that says "Invalid attempt to read when reader is closed" Does anyone have any suggestions on how to fix this? Thanks, Tommy

    A 1 Reply Last reply
    0
    • J jamesbronw

      Hi, I have a wep page that reads from a database in order to get background colors for certain buttons on the page. It works fine when you go to the page and when there is a postback event. When i navigate away from the page and try to go back to it i get an error message that says "Invalid attempt to read when reader is closed" Does anyone have any suggestions on how to fix this? Thanks, Tommy

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

      Are you openning the connection before executing the command? connection.open()

      J 1 Reply Last reply
      0
      • A Anonymous

        Are you openning the connection before executing the command? connection.open()

        J Offline
        J Offline
        jamesbronw
        wrote on last edited by
        #3

        Yes. all of that is located in subprocedures inside of a module i have

        A 1 Reply Last reply
        0
        • J jamesbronw

          Yes. all of that is located in subprocedures inside of a module i have

          A Offline
          A Offline
          Alvaro Mendez
          wrote on last edited by
          #4

          Basically, it's just like the error message says. Somewhere in your code you're attempting to reuse a reader object that you have already closed. Without looking at some code, all I can suggest is that you debug your code and keep track of where connections and readers are being opened/closed to detect the discrepancy. Regards, Alvaro


          Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is. -- GWB, 1999.

          J 1 Reply Last reply
          0
          • A Alvaro Mendez

            Basically, it's just like the error message says. Somewhere in your code you're attempting to reuse a reader object that you have already closed. Without looking at some code, all I can suggest is that you debug your code and keep track of where connections and readers are being opened/closed to detect the discrepancy. Regards, Alvaro


            Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is. -- GWB, 1999.

            J Offline
            J Offline
            jamesbronw
            wrote on last edited by
            #5

            Ok so i have gone through in debug mode and so forth and when it gets to my subprocedure thats calls info from the database it gets to the point of myconn.open then errors out. Is there a way i can force it to open the reader no matter what b/c i cant find a single spot where it would be closed. Or what could cause the reader to not open?

            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