473,395 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

List View Problem -"Argument out of range exception"

hi! Im new with VB.net and Im having prob with listview... "Argument out of range exception"
- the first time i had this, I was able to resolve it by changing the tabs on every textbox. But it appeared again after a day. Here's my code:
=======*****======
If StudList.SelectedItems.Count > 0 Then
Id = StudList.SelectedItems(0).Text
UpdateRec.Show()

UpdateRec.txtStudNo.Text = StudList.SelectedItems(0).SubItems(0).Text
.
.
.
UpdateRec.txtEduc.Text = StudList.SelectedItems(0).SubItems(36).Text >>start of the argument
UpdateRec.txtWork.Text = StudList.SelectedItems(0).SubItems(37).Text
UpdateRec.txtTraining.Text = StudList.SelectedItems(0).SubItems(38).Text
UpdateRec.txtLicense.Text = StudList.SelectedItems(0).SubItems(39).Text

End If
=====*****======
hope you could help me out
Sep 24 '16 #1
2 1145
madankarmukta
308 256MB
at what line of code you are getting an out of range exception, may I please know.

regards.
Sep 24 '16 #2
hi! It was on subitems(36)

I resolved it again by displaying the entire fields of my database in the List View.
=====*****=====
.Add(Table.Rows(i)("Contact_Phone"))
.Add(Table.Rows(i)("Medical_Condition"))
.Add(Table.Rows(i)("Education"))
.Add(Table.Rows(i)("Work"))
.Add(Table.Rows(i)("Training"))
.Add(Table.Rows(i)("License"))

=====*****=====
However, if you have more idea in resolving this matter, it would be greatly appreciated... I might encounter the same error again in the future.
Thanks
Sep 26 '16 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Muhammad Aftab Alam | last post by:
Hi All, I need to know how can I make a list contorl like of windows explorer. From windows explorer view I mean when we open My Computer a list view is shown and the headers are shown as follows...
1
by: ksadek | last post by:
I have a list view that displays messages from a server over an Ip connection. I have set the list view to include a scrolling function, however, I can not figure out how to scroll to the last...
5
by: Praveen R | last post by:
Hi ! I am using a List view control to populate data onto. On the click event of the list view control, i need to find out whether the area clicked has any information of has no information. I...
4
by: El Camino | last post by:
Ok, Picture this... I have a List view already fill with data I want to select one row in the list view with an ID that i retrieve later on in the process Basically its: I have an ID
11
by: Brian Henry | last post by:
Well here is the problem, I have a data set with about 9,000 to 20,000 people in it in the data table "people"... I am then reading it into a list view one at a time row by row... adding each...
0
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another...
3
by: Brian Henry | last post by:
So what is the easiest way to do this? I have one list view with a list of items (in detail view and with about 20 sub items) and a second list view that will take the items they drag from the...
2
by: Miesha.James | last post by:
Hello, I've added a list view to a windows form and I want to add items and subitems to the list at runtime. The problem that I have is that when I try to use the list view control variable it...
2
by: Mohit | last post by:
Hi all, I am working on a windows application with a list view on a form. Now I wanted to show hand cursor when mouse is over list view item and default(arrow) cursor at other places. List...
0
by: stevefromnaki | last post by:
Hi, I have a list of accounts in my list view. I total these and add a new item to the list view. I have changed the font on this to bold but is there a way to add a border around this one item only?...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.