21-06-19, 09:57 PM
PHP كود :
Private Function product_Exists(ByVal num As String) As Boolean
If ConnectionState.Open Then
Conn.Close()
End If
Conn.Open()
Dim cmd As OleDbCommand = Conn.CreateCommand
cmd.CommandText = "SELECT COUNT(*) FROM ur_table where product_number = @product_number"
cmd.Parameters.AddWithValue("@product_number", num)
product_Exists = cmd.ExecuteScalar > 0
Conn.Close()
End Function
ويتم استدعائه كالاتي :
PHP كود :
If cheque_Exists(product_number.Text) = True Then
MsgBox("! هذا المنتج مسجل من قبل")
End If
