Index was outside the bounds of the array.

Posted on 2009-12-29
Last Modified: 2013-12-17

Index was outside the bounds of the array.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

Source Error:

        string[] xFN = new string[10];
        string[] xFV = new string[10];

Line 146:        for (int i = 1; i < 11; ++i)
Line 147:        {
Line 148:            xFN[i] = Request.QueryString["xFN" + i.ToString()];
Line 149:            xFV[i] = Request.QueryString["xFV" + i.ToString()];
Line 150:            if (!String.IsNullOrEmpty(xFN[i]) && !String.IsNullOrEmpty(xFV[i]))

Source File: c:\AceSA_12_12_2009\AceSA_12_12_2009\Prod\AnyTable.aspx    Line: 148

Stack Trace:

[IndexOutOfRangeException: Index was outside the bounds of the array.]
   ASP.prod_anytable_aspx.ParamWhere() in c:\AceSA_12_12_2009\AceSA_12_12_2009\Prod\AnyTable.aspx:148
   ASP.prod_anytable_aspx.GetDataInGridFromAccess() in c:\AceSA_12_12_2009\AceSA_12_12_2009\Prod\AnyTable.aspx:119
   ASP.prod_anytable_aspx.Page_Load() in c:\AceSA_12_12_2009\AceSA_12_12_2009\Prod\AnyTable.aspx:21
   System.Web.Util.CalliHelper.ArglessFunctionCaller(IntPtr fp, Object o) +8
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +8669175
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

Question by:goodk
    1 Comment

    Accepted Solution

    Oops I found the error. The index had to be 12
      string[] xFN = new string[12];
            string[] xFV = new string[12];
    Problem resolved please close this thread - thanks


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now