Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
dsnLocal = "Data Source=""" & LocalWorkstation & """;Initial Catalog=""master"";User Id=""user"";password=""password""" Private Sub SetDatabaseToOffline(ByVal NewDBName As String) Dim con As New SqlClient.SqlConnection(dsnLocal) Try Dim data As New DataSet data = New DataSet con = New SqlClient.SqlConnection(dsnLocal) con.Open() Dim c As New SqlClient.SqlCommand("ALTER DATABASE [" & NewDBName & "]" & vbCrLf _ & "SET OFFLINE", con) c.ExecuteNonQuery() con.Close() con = Nothing Catch ex As Exception MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) Finally If Not con Is Nothing AndAlso con.State <> ConnectionState.Closed Then con.Close() con = Nothing End If End Try End Sub
Join the community of 500,000 technology professionals and ask your questions.