ok, so im trying to execute a query based on the row that a user clicks on...

now for the purpose of testing, the contact_id is set to one, just to ensure that when the code runs it gets an actual data row...

heres my code, that selects an entire row, then simply changes the text on a themed box control...
VB Code:
  1. Private Sub dtaGridContacts_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles dtaGridContacts.MouseUp
  2.  
  3.         Dim rowPoint = New Point(e.X, e.Y)
  4.         Dim hti As DataGrid.HitTestInfo = dtaGridContacts.HitTest(rowPoint)
  5.         If hti.Type = DataGrid.HitTestType.Cell Then
  6.             dtaGridContacts.CurrentCell = New DataGridCell(hti.Row, hti.Column)
  7.             dtaGridContacts.Select(hti.Row)
  8.         End If
  9.  
  10.         'boxContactDetails.Text = "Details: " & dtaGridContacts(hti.Row, 1) & " " & dtaGridContacts(hti.Row, 2)
  11.         Dim dbCmd As OleDb.OleDbCommand
  12.         Dim strSQL = "SELECT * FROM Contacts WHERE contact_id='1'"
  13.  
  14.         dbCmd = New OleDb.OleDbCommand(strSQL, dbConn)
  15.         dbConn.Open()
  16.         Dim dbRead As OleDb.OleDbDataReader = dbCmd.ExecuteReader
  17.  
  18.         If dbRead.Read = True Then
  19.         boxContactDetails.Text = "Details: Of Contact"
  20.         Else
  21.            MessageBox.Show("The contact details you requested could not be " & vbCrLf & "displayed. Please hit the refresh button and try again...", "Contact does not exist!", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
  22.         End If
  23.  
  24.         dbConn.Close()
  25.  
  26.     End Sub

i have kept getting this error when i click the grid...this is the error message...
Code:
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
and this is the line that i get the error on...
VB Code:
  1. Dim dbRead As OleDb.OleDbDataReader = dbCmd.ExecuteReader

Thanks, Justin