To make this general purpose, you need to convert test to int and back again: fortunately this is easy as .NET provides the
int.Parse[
^] and
ToString[
^] methods respectively.
Since this is your homework, you can write the code!
1) Set the initial value of your TextBox to "1"
2) In your Button.Click event handler, read the value of your TextBox Text property and check it has some data. If it does, use the Parse methods to convert it to an integer.
3) Save the value to your database - you will probably need a SqlConnection and a SQLCommand objects. Your lecture notes should cover this part.
4) If it saved ok, add one to the integer, and set the TextBox.Text property to the new value using the ToString method.
5) If it didn't explain why to the user!