Hi marutivsn,
First, add connection string in Web.Config file in ASP.Net Web Forms Application.
If you are working with Windows applications, then use App.Config.
For more details on how to add connection string, please refer below articles.
ASP.Net Web Forms:
ASP.Net Windows:
Connecting Database in Code using VB.Net
You need to make use of SqlConnection and SqlCommand class as they are use for connecting your application to server or database.
Dim query As String = "<SQL QUERY>"
Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
Using con As SqlConnection = New SqlConnection(constr)
Using cmd As SqlCommand = New SqlCommand(query, con)
End Using
End Using
For practical example, refer my article