15-07-19, 03:22 PM
(آخر تعديل لهذه المشاركة : 16-07-19, 04:41 PM {2} بواسطة Rabeea Qbaha.)
PHP كود :
Private Function ID_Exists(ByVal num As Integer) As Boolean
If Conn.State Is ConnectionState.Closed Then
Conn.Open()
End If
Dim cmd As SqlCommand = New SqlCommand("Select count(*) from Unit where ID= @ID", Conn)
cmd.Parameters.AddWithValue("@ID", num)
Dim result = cmd.ExecuteScalar()
Conn.Close()
Return Convert.ToBoolean(result)
End Function
تستطيع فحص التكارا كالاتي:
PHP كود :
If ID_Exists(ID.Text.text) Is True Then
the ID already in database
Else
the ID not in database
End If
