(08-10-19, 08:58 AM)asemshahen5 كتب :PHP كود :
Sub CheckCode()
If TextBox1.Text.Length = 0 Then
Exit Sub
End If
Dim StrSQL As String = "Select * From Clints Where ClintCode=" & TextBox1.Text
Dim da As New SqlDataAdapter(StrSQL, Cnn)
dt.Clear()
da.Fill(dt)
If dt.Rows.Count > 0 Then
MsgBox("هذا الرقم تم حجزه", MsgBoxStyle.Question, "")
Else
Dim StrSQL1 As String = "INSERT INTO Clints (ClintCode) VALUES (" & TextBox1.Text & ")"
Dim da1 As New SqlDataAdapter(StrSQL1, Cnn)
dt.Clear()
da.Fill(dt)
MsgBox("قد تم حجز الرقم لصالحك", MsgBoxStyle.Information, "")
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
CheckCode()
End Sub
بارك الله فيك أخى عاصم ماشاء الله عليك دائماً تحمل فى حوزتك إسعافات أولية سريعة المفعول...

