Collection has reached its maximum capacity

Posted on 2009-05-01
Last Modified: 2012-05-06
Get this error:
Collection has reached its maximum capacity
Listview related i think ,any suggestions?
Question by:RIAS
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    can you show the relevant code?
    how many items did you put in the collection?

    Author Comment

    I have not added any collection
    the code is here
    I am running scripts with 300,000 lines
      If SQL <> "" Then
                        With Results
                            If Not Loading Then GoTo stopload 'Stop the load
                            RecAff = 0 'Reset records affected variable
                            .Add(SQL) 'Add SQL line to results window
                            IntResultsCount = .Count - 1
                            'If .Item(IntResultsCount).SubItems.Count > 0 Then
                            .Item(IntResultsCount).SubItems.Insert(1, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, IniFile))
                            'End If
                            'If .Item(IntResultsCount).SubItems.Count > 1 Then
                            .Item(IntResultsCount).SubItems.Insert(2, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, File.Text))
                            ' End If
                            ExecSQL.CommandText = SQL
                            ExecSQL.Execute(RecAff) 'Execute SQL statement
                            .Item(IntResultsCount).SubItems.Insert(3, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, CStr(RecAff)))
                            ' frmMain.lstResults.ResumeLayout()
                            'End If 'Update results window with the records affected total
                        End With
                    End If

    Open in new window


    Author Comment

    It happens when i rerun the same script
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    >I am running scripts with 300,000 lines
    you mean, 300K lines in the list?
    that's a bit much; you need to redesign that somehow...
    LVL 26

    Accepted Solution

    have you read this link on  
    even this link will also suggest you to redesign the logic


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: HTML5 Specialist

    HTML5 development skills are critical to all developers. HTML5 is the foundation to almost any development process. That's why business, design studios, development shops and other organizations need HTML5 developers. Get your foot in the door as a HTML5 specialist.

    Suggested Solutions

    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    761 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

    12 Experts available now in Live!

    Get 1:1 Help Now