• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1124
  • Last Modified:

Collection has reached its maximum capacity

Get this error:
Collection has reached its maximum capacity
Listview related i think ,any suggestions?
  • 2
  • 2
1 Solution
Guy Hengel [angelIII / a3]Billing EngineerCommented:
can you show the relevant code?
how many items did you put in the collection?
RIASAuthor Commented:
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

RIASAuthor Commented:
It happens when i rerun the same script
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>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...
Anurag ThakurTechnical ManagerCommented:
have you read this link onĀ http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_20491940.html  
even this link will also suggest you to redesign the logic


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now