I have two databases in my vb.net web page. and one databse resides in the same server as a local database (web application and database resides in the same server)
but the second database resides in another server and I am coonecting to this databse using VPN conection via SQL Server Management studio....then how can I coonect to that database programmatically from my web page using vb.net???
itsjp
Member
24 Points
105 Posts
connect to database on different server
Nov 18, 2012 11:44 PM|LINK
Hi,
Hi,
I have two databases in my vb.net web page. and one databse resides in the same server as a local database (web application and database resides in the same server)
but the second database resides in another server and I am coonecting to this databse using VPN conection via SQL Server Management studio....then how can I coonect to that database programmatically from my web page using vb.net???
I tried something like this:
<add name="LoginEx" connectionString="Data Source=SQL.ex.com;Database=exDb;User ID=exad;Password=exexex;Integrated Security=true" />
but its not getting connected to that server.....Can anyone please help me???
sahibas25
Member
147 Points
36 Posts
Re: connect to database on different server
Nov 19, 2012 02:23 AM|LINK
In the "Data Source" , refer Server(System Name or IP address) follows by the Sql Server Name.
like this,
Data Source=Server1\SqlServer
Amy Peng - M...
Star
11650 Points
1082 Posts
Microsoft
Re: connect to database on different server
Nov 20, 2012 01:29 AM|LINK
Hi itsjp,
Have you configured your sql server to allow remote connect? Try to check it and refer to the following article about how to allow remote connection: http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx .
For the connection string, you can try to let Data Source=Ip address of the sql server ;
If you still can not fix this error, please try to show us the error message which occurs when you connect the sql server.
Thanks,
Amy Peng
Feedback to us
Develop and promote your apps in Windows Store