I would like to connect my VB.net application remotely with SQL database server which is placed on different location.
I installed LogMeIn Hamachi on both the server and client machine and joined existing network on the client machine.
I followed the steps provided in this tutorial to enable TCP connection for SQL Server installed on server machine.
I used the following connection string and called Hascon()
on windows form load event to test the connection. Either I am not getting any error also the application is not responding when I build the VB.net application.
Private conn As New SqlConnection With {.ConnectionString = "Data Source=IP address provided by Hamachi,1433;Network Library=DBMSSOCN;Initial Catalog=SIIU;User ID=sa;Password=12345;"}
Public Function Hascon() As Boolean
Try
Sconn.Open()
Return True
Sconn.Close()
Catch ex As Exception
MsgBox(ex.Message)
Return False
End Try
End Function
I have searched in the Internet and tried all the possible solutions but non of solved the problem.
What could be the problem? Any ideas?
Thanks,