Hello Everyone:

I am having problems with the code below. I have copied and pasted the code from a program that I wrote to test and see if the code does work. In that program it does. But when I use the same code in another program I get the following error message. invalidcast exception was unhandled conversion from string “to type integer” is not valid.


Code:
            If intCurrentIndex < ds.Tables(0).Rows.Count - 1 Then
                intCurrentIndex = intCurrentIndex + 1 'EDIT LINE!!!!
                R1011 = ds.Tables(0).Rows(intCurrentIndex).Item("Results01").ToString 'EDIT LINE
                txtResults01.Text = R1011

                'If intCurrentIndex < ds.Tables(0).Rows.Count - 1 Then
                'intCurrentIndex = intCurrentIndex + 1
                'R1011 = ds.Tables(0).Rows(intCurrentIndex).Item("Results01").ToString


The code on the bottom is the copied code that works, intCurrentIndex is a integer and Results01 is in a MDB table.

Any Ideas?

Thanks

Art W.