Note that there are some explanatory texts on larger screens.

plurals
  1. POform_load issue with updating details using session variables and textboxes
    primarykey
    data
    text
    <p>I'm trying to allow users to update their details after logging in on an asp site using vb. Textboxes are populated with user details using session variables in the form_load. The textboxes should be editable but for some reason are not registering the changes when the submit button is clicked. </p> <p>There is a similar question with the same issue <a href="https://stackoverflow.com/questions/2467204/database-not-updating-after-update-sql-statement-in-asp-net">Database not updating after UPDATE SQL statement in ASP.net</a> that was never answered.</p> <p>Please can someone advise</p> <p>Thanks in advance</p> <pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Txt_Fname.Text = Session("First_Name") Txt_LName.Text = Session("Last_Name") Txt_ContactNumber.Text = Session("Cell_Number") Txt_Email.Text = Session("Email_Address") End Sub Protected Sub Cmd_Submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Cmd_Submit.Click Command.Connection = Connection Command.CommandText = "UPDATE dbo.User_Account Set First_Name = @First_Name, Last_Name = @Last_Name, Cell_Number = @Cell_Number, Email_Address = @Email_Address where Overall_ID = @Overall_ID" Command.Parameters.AddWithValue("@First_Name", Txt_Fname.Text) Command.Parameters.AddWithValue("@Last_Name", Txt_LName.Text) Command.Parameters.AddWithValue("@Cell_Number", Txt_ContactNumber.Text) Command.Parameters.AddWithValue("@Email_Address", Txt_Email.Text) Command.Parameters.AddWithValue("@Overall_ID", Session("ID")) Connection.Open() Command.ExecuteNonQuery() Connection.Close() Response.Redirect("MyAccount.aspx") End Sub </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload