I have a datagrid where I have successfully been able to get the current row number to match the selected row. I can also delete a row by an ID number.

What I need to do is match the ID number to the ID number in the currow so I can delete it with my Delete From Statement.

Here is my code so far. What do I need to do?
VB Code:
  1. Dim curRow As Integer
  2. curRow = DataGrid1.CurrentRowIndex
  3. MsgBox(curRow)
  4.  
  5. Dim strDataBaseName As String = "C:\path\dbname.mdb"
  6. Dim cnn As New OleDb.OleDbConnection( _
  7.     "Provider=Microsoft.Jet.OLEDB.4.0;" & _
  8.         "Data Source=" & strDataBaseName)
  9. Dim cmd As New OleDb.OleDbCommand
  10. cnn.Open()
  11. cmd.Connection = cnn
  12. Try
  13.     cmd.CommandText = "Delete From TimeGr Where ID = " & 33 ' map this
  14.         ' to the ID in the current row instead of having it hardwired in
  15.         ' the code.
  16.         cmd.ExecuteNonQuery()
  17. Catch exError As Exception
  18.         MessageBox.Show(exError.Message)
  19. End Try