Kod:
Dim myCmdKayitVarmi As New OleDbCommand("SELECT terminalId FROM tblterminal WHERE terminalKodu=@term", myCnn)
myCmdKayitVarmi.Parameters.AddWithValue("@term", txtTerminalKodu.Text)
Dim dr As OleDbDataReader = myCmdKayitVarmi.ExecuteReader()
If dr.HasRows Then
MessageBox.Show("Bu terminal kodu daha önce kullanılmış. Lütfen yeni bir kod yazınız", "Mükerrer Kayıt", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Else
' Yoksa ekleme işlemi burada yapılabilir
End If