Private Sub cmdGoToWork_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGoToWork.Click
Try
cmd.CommandType = CommandType.Text
'Below Set Select Command (what data you want from the database you are connecting to)
'Set UserNAME to Session Var to save it instead of personal #
Session("UName") = txtUserName.Text
cmd.CommandText = "Update tblUsers set WhyHere='" & rdbToDo.SelectedValue & "', LoggedIn=True where LanID='" & System.Environment.UserName & "'"
'Set the connection to a database
cmd.Connection = con
'Initialize a new dataadaptor
Dim da As New OleDbDataAdapter
'Set the select command text = to the query we wrote
da.SelectCommand = cmd
con.Open()
da.SelectCommand.ExecuteNonQuery()
con.Close()
Select Case rdbToDo.SelectedValue
Case "Answer"
Session("GOHERE") = "answer.aspx"
Case "Work"
Session("GOHERE") = "WorkOutstandings.aspx"
End Select
Response.Redirect(Session("GOHERE"))
Catch ex As Exception
Response.Write(ex.ToString)
End Try
End Sub