hi
this is my table in database
House_info
|
behcode
|
address
|
tell
|
ownername
|
description
|
image
|
name
|
Id
|
|
|
|
|
|
|
|
|
|
in storeinfo.aspx page there is some text box that i bind from database if in database users insert their information it show their data in textbox and they can edit it i use update in my store procedure
when i load storeinfo.aspx if there was data in column in House_info table it show in text box but when i change textbox text and click on imagebutton2 to update data in House_info table it doesn't update House_info table
why?
best regards
LTER procedure [dbo].[insertinfo]
@Name nvarchar(30),@Ownername nvarchar(30),@Behcode nvarchar(10)
),@address nvarchar(max),description nvarchar(max)
,@tell nvarchar(15)
as
begin
update House_info set Name=@Name,Date=GETDATE(),Ownername=@Ownername,BehCode=@Behcode
,address=@address,Tell=@tell,Description=@Description
where BehCode=@Behcode
end
protected void ImageButton2_Click1(object sender, ImageClickEventArgs e)
{
string data = Server.UrlDecode(Request.QueryString["BehCode"]);
SqlCommand _cmd = new SqlCommand("insertinfo", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cn.Open();
_cmd.Parameters.AddWithValue("@Name", txtstore.Text);
_cmd.Parameters.AddWithValue("@Ownername", Txtname.Text);
_cmd.Parameters.AddWithValue("@Description", CKEditorControl1.Text);
_cmd.Parameters.AddWithValue("@address", Txtadd.Text);
|
|
|
_cmd.Parameters.AddWithValue("@tell", Txttell.Text);
|
|
|
_cmd.Parameters.AddWithValue("@behcode", data);
_cmd.ExecuteNonQuery();
_cn.Close();
protected void Page_Load(object sender, EventArgs e)
{
string data = Server.UrlDecode(Request.QueryString["BehCode"]);
SqlCommand _cmd = new SqlCommand("storeinfo1", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cmd.Parameters.AddWithValue("@behcode", data);
_cn.Open();
SqlDataReader _dr = _cmd.ExecuteReader();
while (_dr.Read())
{
txtstore.Text = _dr["name"].ToString();
Txtname.Text = _dr["Ownername"].ToString();
Txtadd.Text = _dr["address"].ToString();
txttell.Text = _dr["tell"].ToString();
CKEditorControl1.Text = _dr["description"].ToString();
}
_cn.Close();
}
|