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. System.ArgumentOutOfRangeException: after site upload

System.ArgumentOutOfRangeException: after site upload

Scheduled Pinned Locked Moved ASP.NET
helpcsharpcssdatabasedotnet
3 Posts 2 Posters 1 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.
  • R Offline
    R Offline
    ranjithib1
    wrote on last edited by
    #1

    Hi all, I have a site uploaded, and after upload v get two major errors that were not present while testing in our local. 1) System.InvalidOperationException: There is already an open DataReader associated with this Connection which must be closed first. We referred several sites and from http://support.microsoft.com/default.aspx?scid=KB;EN-US;319345 its mentioned as This problem was first corrected in Microsoft .NET Framework Service Pack 2 (SP2). So to resolve this, SP2 has to be installed in the web server - is it the only possible solution? Or else how can we manage this in our data access layer. We have cross checked our code & confirmed that every datareader object was closed. 2) System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index From http://support.microsoft.com/kb/332215/#top ,a supported fix is now available from Microsoft, but it is only intended to correct the problem So we need to obtain this to support fix to resolve this problem? What's your suggestion? Pls help

    C 1 Reply Last reply
    0
    • R ranjithib1

      Hi all, I have a site uploaded, and after upload v get two major errors that were not present while testing in our local. 1) System.InvalidOperationException: There is already an open DataReader associated with this Connection which must be closed first. We referred several sites and from http://support.microsoft.com/default.aspx?scid=KB;EN-US;319345 its mentioned as This problem was first corrected in Microsoft .NET Framework Service Pack 2 (SP2). So to resolve this, SP2 has to be installed in the web server - is it the only possible solution? Or else how can we manage this in our data access layer. We have cross checked our code & confirmed that every datareader object was closed. 2) System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index From http://support.microsoft.com/kb/332215/#top ,a supported fix is now available from Microsoft, but it is only intended to correct the problem So we need to obtain this to support fix to resolve this problem? What's your suggestion? Pls help

      C Offline
      C Offline
      codeajay
      wrote on last edited by
      #2

      Hi there, Your major error seems to be errors in your programming itself. This has nothing to do with your local testing or the server. 1. Have a look at the datasets too. Its not only because of datareader that this error occurs. Check your aspx pages for the datasets you might be using. Opening and closing the datasets, using same name for filling different data on the same page, declaration of datasets (avoid using page level declarations where only functional datasets are required) etc. may also cause this problem. 2. Not sure but looks like you are using collections and may be because your database does not have records, this error is occuring. So again at your programming level you need to handle this situation. let me know if this helps.

      R 1 Reply Last reply
      0
      • C codeajay

        Hi there, Your major error seems to be errors in your programming itself. This has nothing to do with your local testing or the server. 1. Have a look at the datasets too. Its not only because of datareader that this error occurs. Check your aspx pages for the datasets you might be using. Opening and closing the datasets, using same name for filling different data on the same page, declaration of datasets (avoid using page level declarations where only functional datasets are required) etc. may also cause this problem. 2. Not sure but looks like you are using collections and may be because your database does not have records, this error is occuring. So again at your programming level you need to handle this situation. let me know if this helps.

        R Offline
        R Offline
        ranjithib1
        wrote on last edited by
        #3

        hi, I have declared datasets in aspx pages DataSet ds; ds = obj.GetFunction(parameter1); I don't understand what is meant by functional datasets,cld u pls explain in details abt it? Then i have declared datareaders as follows SqlDataReader oDr = cmdGetFun.ExecuteReader(); if(oDr.HasRows) { oDr.Read(); obj.Total = oDr.GetInt32(0); obj.UnViewedMessage = oDr.GetInt32(1); } oDr.Close(); Another point is that, if it was a problem with datasets or datareaders,then why there is no error while testing in our local system. Index out of range exception has been admitted as a bug by MS, and they have given a hot fix for that.

        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