Hi there i am trying to count the clicks in a button which i have done but i need to update a table so next time the user log in the label count will display the hits.
this is what i have
Code:
sent.Text = Val(sent.Text) + 1
Dim con AsNew SqlConnection(ConfigurationManager.ConnectionStrings("test").ConnectionString)
Dim cmdd AsNew SqlCommand("UPDATE Users SET NumberEmailSent = '" & Me.sent.Text & " ' Where Name= @Name")
cmdd.Parameters.Add("@Name", Data.SqlDbType.NVarChar, 50).Value = Me.lblUser.Text
cmdd.Connection = con
con.Open()
cmdd.ExecuteNonQuery()
con.Close()
what this does it updates the lable +1 and the table at the same time but if i log out and log in the label is reset to 0 and if i click the button the table will alsow be reset to 1.
i need to be able to add them up
thanks