örnek visual basic kodu:
Dim RsKontrol As ADODB.Recordset
Dim Conn as ADODB:Connection
Dim SQLKontrol As String
Set RsKontrol = New ADODB.Recordset
Set Conn= New ADODB.Connection
Conn.ConnectionString= ........baglanticumlesi.....
Conn.Open
SQLKontrol = "Select * from tablom where email = '" & TxtEmail.Text & "'"
RsKontrol.Open SQLKontrol, Conn, 1, 3
If RsKontrol.RecordCount > 0 Then
MsgBox "Bu e-mail zaten kullanılıyor."
Exit Sub
Else
kayıt işlemi........................
End If Örnek t-SQL kodu
declare @deger int
set @deger='dasdadas@ad.com'
if exists(select *from tablom where email=@deger)
RAISERROR
('Bu email zaten kullanılıyor', 16, 1)
else
insert into tablom (email) values (@deger)
|