let suppose 4/1000=250 and now 250 is , match in Product_Price Field in RstProductDetails, and select only Restaurant where 250 is matched. Next when a user select Restaurant e.g KFC and then KFC Products details is show.
Here is my [WebMethod]
[WebMethod]
public DataSet Restaurant(string amount, string persons)
{
// DataSet result = Amount / personHash;
decimal price = amount \ persons ;
DataSet result = null;
const string SQL_COMMAND_TEXT = "SELECT Rst_Name FROM RstProductDetails WHERE Product_Price WHERE Product_rice< = @price";
using (SqlConnection connection = Class1.GetConnection())
{
connection.Open();
using (SqlCommand command = new SqlCommand(SQL_COMMAND_TEXT, connection))
{
command.Parameters.Add("@Rst_Name", SqlDbType.NVarChar);
command.Parameters.Add("@PersonHash", SqlDbType.NVarChar);
command.Parameters.Add("@price", SqlDbType.Decimal);
command.Parameters["@Rst_Name"].Value = amount;
command.Parameters["@persons"].Value = persons;
command.Parameters["@price"].Value = price;
using (SqlDataAdapter dataAdapter = new SqlDataAdapter(command))
{
result = new DataSet();
dataAdapter.Fill(result);
}
}
}
return result;
}
Here is my databse relation diagram
Replies
Know the answer? Post it — somebody with the same question will find it here.