View Single Post
Eski 16/10/2007, 13:00   #6 (permalink)
zuzuu
Eski Cevizci
 
zuzuu Adlı Üyenin Profil Grafiği
 
Üyelik Tarihi: 05/2005
Mesaj: 289
Varsayılan

ö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)
zuzuu hatta değil   Alıntı Yaparak Yanıtla