Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
html code:
XML
<asp:TextBox ID="TextBox1" runat="server"> retrival data fro sql</asp:TextBox>
     <br />
     <asp:Button ID="Button1" runat="server" Text="Button" />


c# code:
C#
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();

  }
Posted

didnt understand your question but if you want to update column value based on textbox then

C#
SqlCommand sqlcom = new SqlCommand("update tablename set columnname='"+TextBox1.Text+"' where id='"+str_id+"'", sqlcon);
 
Share this answer
 
cant understand your question can you clarify that
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900