[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 539
  • Last Modified:

InvalidArgument=Value of '0' is not valid for 'index'+listview +vb.net 2005

Hi,
This piece of code gives the error :
InvalidArgument=Value of '0' is not valid for 'index'.
Parameter name: index

   If Results.Item(IntResultsCount).SubItems.Count > 4 Then'this line errors
                        .Item(IntResultsCount).SubItems(3).Text = Err.Number
                    Else
                        .Item(IntResultsCount).SubItems.Insert(3, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, Err.Number))
                    End If

Any help appreciated.
Cheers
IndexError.png
0
RIAS
Asked:
RIAS
  • 2
1 Solution
 
Paul MacDonaldDirector, Information SystemsCommented:
How many Items does Results have at that point?
0
 
RIASAuthor Commented:
How do I check that?
0
 
Paul MacDonaldDirector, Information SystemsCommented:
Run it in debug mode, stepping through the code at that point.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

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