x First time here? Check out the FAQ
  • Avatar466posts729karma

    Limit on number of countries?

    Paul Blair started this topic February 24, 2012 @ 03:51, Go directly to the topic solution

    Is there a limit on the number of countries that can be loaded. Upon loading the 110th country I get the following error:

    Exception Details: System.InvalidOperationException: Operation is not valid due to the current state of the object.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [InvalidOperationException: Operation is not valid due to the current state of the object.]
       System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() +2420258
       System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) +58
       System.Web.HttpRequest.FillInFormCollection() +159
    [HttpException (0x80004005): The URL-encoded form data is not valid.]
       System.Web.HttpRequest.FillInFormCollection() +217
       System.Web.HttpRequest.get_Form() +104
       System.Web.HttpRequest.get_HasForm() +9038047
       System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97
       System.Web.UI.Page.DeterminePostBackMode() +69
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +13

    I'm loading via a SQL script, but the error occurs whether I load the 110th item through the script or manually through the admin section. My script looks like:

    declare @sh int;
    declare @sort int;

    set @Sh=2;

    INSERT INTO [TeaCommerce_Country]
    (@sh, 'Sweden', 'SE', 0, 0, 1, 1),
    (@sh, 'United Kingdom', 'UK', 0, 0, 1, 1), ....



  • Avatar466posts729karma
    Comment with ID: 109097
    Paul Blair posted this reply February 25, 2012 @ 11:44

    nice one. Thanks Anders

Please login or Sign up To post replies