0

Hello Im trying to display a label when my program starts,

to check the server status..
For example if the user is successfully connected to the server it should say on the label "Connected" and if not the label should say "Not Connected" , my Database is located on a remote server.

I tried to disconnect to the internet and use this code but ending up not showing up the form.

    Try
            dataopen()
            If conn.State = ConnectionState.Open Then
                rlabel1.text = "Connected"
            Else
                rlabel1.text = "Not connected"
            End If
        Catch ex As Exception

        End Try

THANKS!

3
Contributors
2
Replies
18
Views
3 Years
Discussion Span
Last Post by ryanjayson
0

check for internet connectivity first:

        Try
            If My.Computer.Network.Ping("daniweb.com") Then
                dataopen()
                If conn.State = ConnectionState.Open Then
                    rlabel1.text = "Connected"
                Else
                    rlabel1.text = "Not connected"
                End If
            End If
        Catch ex As Exception
            rlabel1.text = "No Internet Connectivity"
        End Try
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.