G
Guest
Hi there
I have had an application where I have not been able to successully add an 'update details page' for my clients logged in to the website.
I have posted a query on this before and the result was that the WHERE clause was probably wrong; without success....but I have added a test labels to test so now know a little more so hopefully you can help.
Have ASP.NET / SQL Server 2000. The web app has a members area which is https. i'm using authenication ticket which stores the member ID ref as a state variable called 'MemberRef'
So problem page....
When this UPDATE PERSONAL DETAILS page loads, it fills the textboxes on the page with a datareader according to who is logged in. One textbox example is as follows:
txtFirstName.Text = rdr("colFName")
Then of course I need a process so my members can update their personal details stored in the DB, so those text boxes allow updates and I've added a button which should update the DB
Private Sub ButUpdatePractice_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 'Handles ButUpdatePractice.Click
Dim strCOMP As String
Dim conCOMP As SqlConnection
Dim cmdUPDATECOMP As SqlCommand
conCOMP = xxx
cmdUPDATECOMP = New SqlCommand(strCOMP, conCOMP)
strCOMP = "UPDATE ClientDetails SET colFName = @Fname WHERE MemberRef = @MemberRef"
cmdUPDATE.Parameters.Add("@Fname", txtFirstName.Text)
cmdUPDATE.Parameters.Add("@@MemberRef", MemberRef)
conCOMP.Open()
cmdUPDATECOMP.ExecuteNonQuery()
conCOMP.close
-now plrease ignore any misspellings above - done it for speed for this forum.
Now this doesn't update the DB when pressing the update button. It re-freshes the page. I've added a label to the page which shows the strCOMP update string on the page to test ( label1.text = strCOMP ) and it contains the existing value from the DB.
Please help.
I have had an application where I have not been able to successully add an 'update details page' for my clients logged in to the website.
I have posted a query on this before and the result was that the WHERE clause was probably wrong; without success....but I have added a test labels to test so now know a little more so hopefully you can help.
Have ASP.NET / SQL Server 2000. The web app has a members area which is https. i'm using authenication ticket which stores the member ID ref as a state variable called 'MemberRef'
So problem page....
When this UPDATE PERSONAL DETAILS page loads, it fills the textboxes on the page with a datareader according to who is logged in. One textbox example is as follows:
txtFirstName.Text = rdr("colFName")
Then of course I need a process so my members can update their personal details stored in the DB, so those text boxes allow updates and I've added a button which should update the DB
Private Sub ButUpdatePractice_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 'Handles ButUpdatePractice.Click
Dim strCOMP As String
Dim conCOMP As SqlConnection
Dim cmdUPDATECOMP As SqlCommand
conCOMP = xxx
cmdUPDATECOMP = New SqlCommand(strCOMP, conCOMP)
strCOMP = "UPDATE ClientDetails SET colFName = @Fname WHERE MemberRef = @MemberRef"
cmdUPDATE.Parameters.Add("@Fname", txtFirstName.Text)
cmdUPDATE.Parameters.Add("@@MemberRef", MemberRef)
conCOMP.Open()
cmdUPDATECOMP.ExecuteNonQuery()
conCOMP.close
-now plrease ignore any misspellings above - done it for speed for this forum.
Now this doesn't update the DB when pressing the update button. It re-freshes the page. I've added a label to the page which shows the strCOMP update string on the page to test ( label1.text = strCOMP ) and it contains the existing value from the DB.
Please help.