Question:

Anyone here who knows how to make a remote connection to SQL server from visual studio?

by  |  earlier

0 LIKES UnLike

I want to connect to a server in my LAN.

If u know let me know :) , so I can ask u a few Qs.

if not,Do u know any website or forum which i may find my answer in?

 Tags:

   Report

1 ANSWERS


  1. I used the following functions for a project I created to connect to a remote server. Maybe this is what you are looking for.

        Public Sub connect()

            sqlDataSource.ConnectionString = "Data Source=www.databaselocationorip.com;User Id=user_name;Password=your_pass;Initial Catalog=DB_name;"

            sqlConnection = New SqlConnection(sqlDataSource. ConnectionString)

            sqlConnection.Open()

        End Sub

        Public Sub closeDataReader()

            sqlDataReader.Close()

        End Sub

        Public Sub close()

            sqlDataReader.Close()

            sqlCmd.Dispose()

            sqlConnection.Close()

        End Sub

        Public Function getDataSource() As SqlDataSource

            Return sqlDataSource

        End Function

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.