First of all, do not ever concatenate values directly to the SQL statement. This leaves you wide open to SQL injections. Instead use
SqlParameter[
^].
Then you don't need the adapter. Simply:
Dim con As New SqlConnection("Data Source=CSC32\SQLEXPRESS;Initial Catalog=Data1;Integrated Security=True;")
con.Open()
Dim cmd As New SqlCommand("update Logs set Email=@email, DOB=@dob, Secques=@Secques,Secans=@Secans where Username=@username", con)
...
cmd.Parameters.AddWithValue("@Secques", sqtext.Text)
...
cmd.ExecuteNonQuery()
con.Close()
Also
- using debugger check that you really use the latest values when assigning the text into parameters.
- it's advisable to use
using[
^] statement for the connection
- and better yet wrap the DML operations inside a
SqlTransaction[
^]