如何更新编辑文本框 [英] how to update in edit a textbox
本文介绍了如何更新编辑文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
html代码:
html code:
<asp:TextBox ID="TextBox1" runat="server"> retrival data fro sql</asp:TextBox>
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
c#code:
c# code:
protected void Button1_Click(object sender, EventArgs e)
{
string str_id = cell_id.InnerText.ToString();
sqlcon.Open();
SqlCommand sqlcom = new SqlCommand("updata tableName set colum name where id='"+str_id+"'", sqlcon);
sqlcom.ExecuteNonQuery();
sqlcon.Close();
}
推荐答案
没有理解你的问题,但如果你想根据文本框更新列值,那么< br $>
didnt understand your question but if you want to update column value based on textbox then
SqlCommand sqlcom = new SqlCommand("update tablename set columnname='"+TextBox1.Text+"' where id='"+str_id+"'", sqlcon);
无法理解你的问题,你可以澄清一下吗
cant understand your question can you clarify that
这篇关于如何更新编辑文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文