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