Never tested on this but try something like this:
C#:
protected void Button1_Click(object sender, EventArgs e){
int sum = int.Parse(TextBox1.Text.Trim()) + 1;
TextBox1.Text = sum.ToString();
}
VB.NET:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim sum As Integer = Integer.Parse(TextBox1.Text.Trim()) + 1
TextBox1.Text = sum.ToString()
End Sub
This will increment the value of your TextBox to 1 everytime you clicked on the Button.
Important note:
Also, I will not recommend you to append the values directly into your SQL statements especially when doing inserts because that would leads you to SQL Injection , use Parameterized Query instead for security..




Reply With Quote