HI
I have some textbox -dropdownlist and check box in Edit.aspx page that users can edit their information on this page
these are my code
protected void ImageButton2_Click1(object sender, ImageClickEventArgs e)
{
int data1 = Convert.ToInt32(Request.QueryString["id"].ToString());
SqlCommand _cmd = new SqlCommand("Editestate1", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cn.Open();
_cmd.Parameters.AddWithValue("@Type", ddltypeE.SelectedItem.Text);
_cmd.Parameters.AddWithValue("@Measure", txtMesureE.Text);
_cmd.Parameters.AddWithValue("@Price", TxtpriceE.Text);
_cmd.Parameters.AddWithValue("@ID", data1);
_cmd.ExecuteNonQuery();
Session["Message"] = true;
Response.Redirect(Request.Url.AbsoluteUri);
_cn.Close();
}
and on page load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
int data1 = Convert.ToInt32(Request.QueryString["Id"].ToString());
SqlCommand _cmd = new SqlCommand("VIEWESTATE", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cmd.Parameters.AddWithValue("@id", data1);
_cn.Open();
SqlDataReader _dr = _cmd.ExecuteReader();
while (_dr.Read())
{
txtMesureE.Text = _dr["Measure"].ToString();
TxtpriceE.Text = _dr["Price"].ToString();
ddltypeE.Items.FindByText(_dr["Type"].ToString()).Selected = true;
}
and SP
ALTER procedure [dbo].[Editestate1]
,@Type nvarchar(20)
,@Measure varchar(20)
,@Price nvarchar(20)
0)
,@id int
AS BEGIN
UPDATE Estate_p
SET
,Type=@Type
,Measure=@Measure
,Price=@price
WHERE ID=@id
END
my problem is that when I change textbox's text or dropdownlist item and click on button it didn't update data in database it didn't show any error but didn't update...
I set breakpoint on image button2_click event and have checked Txtmeasure and txtpriceE Text and I saw that these text box had my last value I mean i.e Txtmeasure .text was=200
and I changed it to=300 when I set break point and checked Txtmeasure.text I saw that txtmeasure.text=200 not 300 that I changed
so what can I do
Thanks alot