25-08-19, 08:27 PM
(آخر تعديل لهذه المشاركة : 25-08-19, 08:27 PM {2} بواسطة Rabeea Qbaha.)
PHP كود :
Private Function ID_Exists(ByVal num As Integer) As Boolean
If Conn.State = 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) = True Then
the ID already in database
Else
the ID not in database
End If
