Dim cn As SqlConnection
Dim com As SqlCommand
Dim dr As SqlDataReader
Dim strcon As String
Dim strqry As String
Try
strcon = System.Configuration.ConfigurationManager.AppSettings("Variable1).ToString()
strqry = "You SQL QUERY HERE"
cn = New SqlConnection(strcon)
cn.Open()
com = New SqlCommand(strqry, cn)
dr = com.ExecuteReader
If dr.Read < 0 then
(TRUE CONDITION HERE)
Else
(FALSE CONDITION HERE)
END IF
cn.Close()
dr.Close()
com.Dispose()
Catch ex As Exception
Response.write("You Error Message Here") or use LABELERROR.Text("MESSAGE") (mostly "Internal Server Error")
End Try