469,072 Members | 1,844 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,072 developers. It's quick & easy.

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 915
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

Post your reply

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

Similar topics

1 post views Thread by Muhammad Aftab Alam | last post: by
1 post views Thread by ksadek | last post: by
5 posts views Thread by Praveen R | last post: by
4 posts views Thread by El Camino | last post: by
2 posts views Thread by Miesha.James | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.