hi
this is serialfilm table in database:
Id
|
Name
|
PriceDvd
|
1
|
Waterfall
|
1000
|
2
|
Winter
|
2000
|
and in film.aspx page is textbox that users can enter number on this textbox I want when users enter number in textbox it will multiply pricedvd column's value with number that users enter in textbox...
below is codes:
protected void Zarib_Click(object sender, ImageClickEventArgs e)
{
using (SqlConnection conn = General.GetConnection())
{
using (SqlCommand _cmd = General.GetCommand("Zarib_Update", conn))
{
conn.Open();
_cmd.Parameters.AddWithValue("@Zarib", int.Parse(Txtzarib.Text));
_cmd.ExecuteNonQuery(); Response.Redirect("Film.aspx");
}
}
}
and sp:
ALTER procedure [dbo].[Zarib_Update]
@Zarib int
AS
BEGIN
declare @PriceDvd Int SET @PriceDvd=(SELECT PriceDvd From SerialFilm )
UPDATE SerialFilm
SET
PriceDvd=@Zarib*@PriceDvd
END
but when I click on button this error happen:
Server Error in '/' Application.
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
where is problem...
Best regards
neda