Ok it's very simple your function is accepting 2 parameters 1) Amount 2) Person
in your function calculate amount
decimal price = amount \ persons
and this price as parameter
WHERE Product_rice< = @price";
command.Parameters.Add("@price", SqlDbType.Decimal);
command.Parameters["@price"].Value = price;