1
Reply

problem in simple reading from datagridview

ahmed fahd

ahmed fahd

Jan 14 2013 2:44 PM
993

   Dim a As Integer
        For a = 0 To DataGridView1.Rows.Count - 2 Step 1

            myobjects._emp_num = DataGridView1.Rows(a).Cells(0).Value
            myobjects._emp_name = DataGridView1.Rows(a).Cells(1).Value
            myobjects._emp_situation = DataGridView1.Rows(a).Cells(2).Value
            myobjects._day_date = DataGridView1.Rows(a).Cells(3).Value
            com.add_al7door(myobjects)

        Next

this loop works so good to the last row when it be upon the last row ,data grid tells me that

DataGridView1.Rows(a).Cells(2).Value     has no value although i gave it value and other cells in the same row has the value already


Answers (1)