4

I created multiple combo-boxes from which i extracted data for each of them from the stored procedure created, all these boxes were working until earlier on today, 2 of the combo boxes stopped working, on checking the "immediate window" for the rows and columns,i got results for the columns but when i check for the columns e.g ?dsContactTitles.Tables(0).Rows i get the following as part of the list that comes up:

item: In order to evaluate an indexed property, the property must be qualified and the 
arguments must be explicitly supplied by the user.

else when i check for a specific row i get an ArrayOutOfBoundException. this was working perfectly for a long time, please would anyone know the cause of this inconsistency?.

Jide
  • 133
  • 1
  • 2
  • 12

1 Answers1

3

Since you are dumping the entire Rows object in the immediate window, you are seeing the list of properties for the Rows object. One of the properties is Item, but this requires an index in order to display any valid data, which is what the message is telling you.

If you look at ?dsContactTitles.Tables(0).Rows.Item(0), then you will see the first row, if one exists.

If you check a specific row and get an index out of bounds error, then that means you are no longer retrieving the row from the database. Try executing your stored procedure manually to see if it is returning the values you expect. If not, you either need to update your database or the stored procedure.

competent_tech
  • 44,465
  • 11
  • 90
  • 113
  • okay that makes sense,i am getting an IndexOutOfRange Exception so i will update the stored procedure now and see if it works because i am getting the values i expect.How do i update the stored procedure/database? – Jide Aug 03 '12 at 09:40
  • 1
    I figured it out, it was reading companyID=1 whereby my companyID on my system was 2 due to technical changes. so had to change the companyid in my database = 2.. so if anyone has such problems be wary of such – Jide Aug 03 '12 at 16:47