Im new to vb.net and for some odd reason my delete is not working.It says Data type mismatch in criteria expression.
Dim currentRows = DataGridView1.CurrentRow.Index
If Not cnn.State = ConnectionState.Open Then
cnn.Open()
End If
If txtCompany.Text <> "" Then
Dim cmd As New OleDb.OleDbCommand
If MsgBox("Do you want to delete this account?", vbYesNo) = MsgBoxResult.Yes Then
cmd.Connection = cnn
cmd.CommandText = "DELETE FROM [Work] WHERE eNum = '" & num & "'AND cResign = '" & dpResign.Value.Date & "' ;"
cmd.CommandType = CommandType.Text
cmd.Connection = cnn
cmd.ExecuteNonQuery()
End If
End If