Imports System.Data.SqlClient

Public Class Dashboard1
    Inherits System.Web.UI.Page

    Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        Try

            sqlMessages.ConnectionString = Logic.Database.connectionString
            sqlMessages.SelectParameters("clientId").DefaultValue = SessionVars.ClientId(Session)

            Using connection As New SqlConnection(Logic.Database.connectionString)
                connection.Open()
                Dim cmd As New SqlCommand("SELECT TOP 1 WebClientMessage FROM Company", connection)
                Dim message = Logic.Conversion.ToString(cmd.ExecuteScalar())
                litMessage.Text = HttpUtility.HtmlEncode(message)
            End Using

        Catch ex As Exception
            Dim errorId = Logic.Error.Log(ex)
            Response.Redirect("/Error.aspx?id=" & errorId)
        End Try
    End Sub

End Class