|
-
Feb 18th, 2003, 03:22 PM
#1
Thread Starter
Member
update help
There's probably something obvious I'm missing here, but I can't get this code to update my Access table...
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
If (rb1Y.Checked Or rb1N.Checked) Then
Response.Redirect("orientationB.aspx")
Else
'advise of error
l blError.Text = ">> There is at least one Yes/No question left unanswered. Please review. <<"
Exit Sub
End If
'update answer table
If rb1Y.Checked Then
DsAnsOA1.Tables("tableOAAns").Rows(0).Item(1) = "yes"
Else
DsAnsOA1.Tables("tableOAAns").Rows(0).Item(1) = "no"
End If
DsAnsOA1.Tables("tableOAAns").Rows(0).Item(2) = tb2.Text
DsAnsOA1.Tables("tableOAAns").Rows(0).Item(3) = tb3.Text
DsAnsOA1.Tables("tableOAAns").Rows(0).Item(4) = tb4.Text
daA.Update(DsAnsOA1)
Catch ex As Exception
Finally
' nothing here yet
End Try
End Sub
can anyone give me a clue?...
thanks much...Ooogs
-
Feb 20th, 2003, 08:51 PM
#2
Hyperactive Member
Your code is never actually getting to the database part. It either redirects or exits the sub.
-
Feb 24th, 2003, 10:26 AM
#3
Thread Starter
Member
I revised it a bit...
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
If (rb1Y.Checked Or rb1N.Checked) Then
'update answer table
If rb1Y.Checked Then
DsAnsOA1.Tables("tableOAAns").Rows(0).Item(0) = "yes"
ElseIf Not rb1Y.Checked Then
DsAnsOA1.Tables("tableOAAns").Rows(0).Item(0) = "no"
End If
DsAnsOA1.Tables("tableOAAns").Rows(0).Item(1) = tb2.Text
DsAnsOA1.Tables("tableOAAns").Rows(0).Item(2) = tb3.Text
DsAnsOA1.Tables("tableOAAns").Rows(0).Item(3) = tb4.Text
daA.Update(DsAnsOA1)
Response.Redirect("orientationB.aspx")
Else
'advise of error
lblError.Text = ">> There is at least one Yes/No question left unanswered. Please review. <<"
Exit Sub
End If
Catch ex As Exception
Finally
End Try
End Sub
...but it doesn't ever seem to get to the response.redirect command. It never leaves the page. Can anyone see what I'm missing?
Thanks...Ooogs
-
Feb 24th, 2003, 10:48 AM
#4
PowerPoster
On your catch block, put a break in with the IDE, then run your code. Figure out what the exception is.
-
Feb 24th, 2003, 01:37 PM
#5
Thread Starter
Member
No exception is being thrown. It's just not advancing to the redirected page.
-
Feb 24th, 2003, 01:44 PM
#6
PowerPoster
How about stepping through each line in debug mode. Find out if you are even processing the Response.Redirect line. It looks right to me, as long as there is a page by the orientationB.aspx name in the same folder.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|