Jump to content

Updating the database


ZeroShade

Recommended Posts

I have an editor in the form of a textarea and a button and a label. Right now... there is data in the database table which the label is calling. I also have the editor calling the data from the label. But now I want to set it up so that a user can take whats in the editor.. add more lines to it or something... click the update button and it updates the database with the next data. How do I do this?

Link to comment
Share on other sites

If you had these two controls on your page:

<asp:TextBox id="MyTextBox" TextMode="MultiLine" runat="server" /><asp:Button id="UpdateButton" runat="server" OnClick="UpdateButton_Click" Text="Update" />

Then, in your code-behind, you could have this event handler:

protected void UpdateButton_Click(object sender, EventArgs e){	string text = MyTextBox.Text;	// Make the connection to your database and run your UPDATE 	// query with the value you have above.}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...