troubleshooting Question

Setting last field of data table to be a hyperlink

Avatar of -cr-
-cr- asked on
.NET ProgrammingVisual Basic.NETEditors IDEs
4 Comments1 Solution1056 ViewsLast Modified:
I have the code below and need to make the last field a hyperlink to VeiwQuoteID.aspx

  Dim EMailLogDataStoredProcedure As String

        Select Case Request.QueryString("sp")
            Case "1"
                EMailLogDataStoredProcedure = "usr_sel_EMailLog_BrokerAdministrationEMailLogOutput"
            Case "2"
                EMailLogDataStoredProcedure = "usr_sel_EMailLog_BrokerAdministrationEMailLogOutput_BrandedPageOwnerEMailOutput"
            Case "3"
                EMailLogDataStoredProcedure = "usr_sel_EMailLog_BrokerAdministrationEMailLogOutput_ManagerEmployeeEMailOutput"
        End Select
        Dim dt As New DataTable
        'dt.Columns.Add("ID", GetType(Integer))
        dt.Columns.Add("Sender", GetType(String))
        dt.Columns.Add("Recipient", GetType(String))
        dt.Columns.Add("Subject", GetType(String))
        dt.Columns.Add("SentDate", GetType(DateTime))
        dt.Columns.Add("View", GetType(String))

        'Dim Crypter As New Encryption64
        Dim strBrokerEmail As String = Request.Cookies("BrokerEMailAddress").Value
        'MsgBox(strBrokerEmail, MsgBoxStyle.Information, "Broker Email")
        Dim strSP As String = EMailLogDataStoredProcedure
        Dim EMailLogDataConnString As String = ConfigurationManager.AppSettings("***")
        Dim EMailLogDataConn As New SqlConnection(EMailLogDataConnString)
        Dim SQLEMailLogDataCmd As New SqlCommand(strSP, EMailLogDataConn)
        Dim EMailLogData As SqlDataReader
        SQLEMailLogDataCmd.CommandType = CommandType.StoredProcedure
        SQLEMailLogDataCmd.Parameters.AddWithValue("@BrokerEMailAddress", strBrokerEmail)
        SQLEMailLogDataCmd.Parameters.AddWithValue("@StartDate", StartDate.Text)
        SQLEMailLogDataCmd.Parameters.AddWithValue("@EndDate", EndDate.Text)
        EMailLogDataConn.Open()
        EMailLogData = SQLEMailLogDataCmd.ExecuteReader
        While EMailLogData.Read
            dt.Rows.Add(New Object() {LCase(EMailLogData("Sender")), LCase(EMailLogData("Recipient")), LCase(EMailLogData("Subject")), LCase(EMailLogData("SentDate")), LCase(EMailLogData("QuoteID"))})
        End While

        If EMailLogData.HasRows = False Then
            lblNoResults.Visible = False
            lblNoResults.Text = "**Sorry there were no results for your query"
            lblNoResults.Visible = True
        End If
        If EMailLogData.HasRows = True Then
            lblNoResults.Visible = False
            Grid1.DataSource = dt
            Grid1.DataBind()
            Grid1.Visible = True
        End If
        SQLEMailLogDataCmd.Dispose()
        SQLEMailLogDataCmd = Nothing
        EMailLogData.Close()
        EMailLogData = Nothing
        EMailLogDataConn.Close()
        EMailLogDataConn.Dispose()
        EMailLogDataConn = Nothing
        EMailLogDataConnString = Nothing
ASKER CERTIFIED SOLUTION
adam_pedley

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros