<%@ Page Language="vb" %>
<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "System.Data.SQL" %>
<html>
<head>
<script runat=server>
Sub Page_Load(ByVal Sender As Object, ByVal e As EventArgs)
'On Error Resume Next
Dim cn As SQLConnection
cn = New SQLConnection("server=localhost;uid=sa;pwd=;database=pubs;")
cn.Open()
If cn.State = 1 Then
lblReturnCode.Text = "The Connection State is: " & cn.State & " - Connection Succeeded"
Else
lblReturnCode.Text = "The Connection State is: " & cn.State & " - Connection Failed"
End If
End Sub
</script>
</head>
<body>
<asp:Label id="lblReturnCode" Runat=server />
</body>
</html>