hi
in film.aspx is textbox that users can enter number I want this number multiply with Pricedvd column's data in database:
Id
|
Name
|
PriceDvd
|
1
|
Waterfall
|
1000
|
2
|
Winter
|
2000
|
i.e
if users enter 5 in textbox I want table change like:
Id
|
Name
|
PriceDvd
|
1
|
Waterfall
|
5000
|
2
|
Winter
|
10000
|
below are code:
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");
}
}
}
SP:
ALTER procedure [dbo].[Zarib_Update]
@Zarib varchar(5)
AS
BEGIN
declare @PriceDvd Int SET @PriceDvd=(SELECT PriceDvd From SerialFilm where daste='فیلم')
UPDATE SerialFilm
SET
PriceDvd=@Zarib*@PriceDvd
END
but here when I enter number in text box it insert NULL in Pricedvd column:
Id
|
Name
|
PriceDvd
|
1
|
Waterfall
|
NULL
|
2
|
Winter
|
NULL
|
can you help me?
Best Regards
Neda