What is datatable index
It does not add the row to the DataTable & you cannot get the index until you add the new row to the table. Here's an example (assuming dt is the DataTable) Dim row As DataRow = dt.NewRow() ' IndexOf() will return -1 if called here dt.Rows.Add(row) ' get the index now MsgBox(dt.Rows.IndexOf(row))