By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,882 Members | 2,482 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,882 IT Pros & Developers. It's quick & easy.

Connect To Local SQL Server DB From Remote Server

P: n/a
RN1
Is it possible to connect to my local SQL Server 2005 database from a
remote web server? If yes, what ConnectionString do I use?

Thanks,

Ron
Aug 20 '08 #1
Share this Question
Share on Google+
7 Replies


P: n/a
RN1 wrote:
Is it possible to connect to my local SQL Server 2005 database from a
remote web server? If yes, what ConnectionString do I use?

Thanks,

Ron
This should be helpful:

How to configure SQL Server 2005 to allow remove connections:
http://support.microsoft.com/default...b;EN-US;914277

How to configure Express to accept remote connections:
http://blogs.msdn.com/sqlexpress/arc...05/415084.aspx

--
Göran Andersson
_____
http://www.guffa.com
Aug 20 '08 #2

P: n/a
Sure, but the server will need to connect to your machine IP address. Are
they on the same local network?

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"RN1" <rn**@rediffmail.comwrote in message
news:bd**********************************@n33g2000 pri.googlegroups.com...
Is it possible to connect to my local SQL Server 2005 database from a
remote web server? If yes, what ConnectionString do I use?

Thanks,

Ron

Aug 20 '08 #3

P: n/a
RN1
On Aug 20, 6:39*pm, Göran Andersson <gu...@guffa.comwrote:
RN1 wrote:
Is it possible to connect to my local SQL Server 2005 database from a
remote web server? If yes, what ConnectionString do I use?
Thanks,
Ron

This should be helpful:

How to configure SQL Server 2005 to allow remove connections:http://support.microsoft.com/default...b;EN-US;914277

How to configure Express to accept remote connections:http://blogs.msdn.com/sqlexpress/arc...05/415084.aspx

--
Göran Andersson
_____http://www.guffa.com
Thanks Goran for the prompt response. I had already gone through the 2
articles before posting my question. Actually my main intention is to
connect to a remote SQL Server 2005 dataabse from my local SSMS but am
not able to do so inspite of following all the steps that have been
stated in the 2 articles (& numerous other articles as well). I even
tried telnetting to the remote SQL Server but it generates an error
saying that "could not open port 1433".

This is the reason why I want to connect to my local SQL Server 2005
DB from the remote web server which is why I need the ConnectionString
to connect to my local SQL Server DB from the remote web server. As
such, to connect to my local SQL Server 2005 DB from my local web
server, I use the following ConnectionString in ASP.NET pages:

sqlConn = New SqlConnection("Data Source=RON\SQLEXPRESS;Initial
Catalog=MyDB;Integrated Security=True")

But the above won't work with the ASP.NET pages in the remote web
server. I have gone through the ConnectionStrings at www.connectionstrings.com
but couldn't find anything relevant.

Could you please help me out with the ConnectionString?

Thanks,

Ron
Aug 20 '08 #4

P: n/a
RN1
On Aug 20, 6:40*pm, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@mMvVpPsS.orgwrote:
Sure, but the server will need to connect to your machine IP address. Are
they on the same local network?

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net

"RN1" <r...@rediffmail.comwrote in message

news:bd**********************************@n33g2000 pri.googlegroups.com...
Is it possible to connect to my local SQL Server 2005 database from a
remote web server? If yes, what ConnectionString do I use?
Thanks,
Ron- Hide quoted text -

- Show quoted text -
>Sure, but the server will need to connect to your machine IP address. Are
they on the same local network?
Sorry I didn't get you. What do you mean by "server" here - local SQL
Server, local web server, remote SQL Server or remote web server?

Ron
Aug 20 '08 #5

P: n/a
RN1 wrote:
On Aug 20, 6:39 pm, Göran Andersson <gu...@guffa.comwrote:
>RN1 wrote:
>>Is it possible to connect to my local SQL Server 2005 database from a
remote web server? If yes, what ConnectionString do I use?
Thanks,
Ron
This should be helpful:

How to configure SQL Server 2005 to allow remove connections:http://support.microsoft.com/default...b;EN-US;914277

How to configure Express to accept remote connections:http://blogs.msdn.com/sqlexpress/arc...05/415084.aspx

--
Göran Andersson
_____http://www.guffa.com

Thanks Goran for the prompt response. I had already gone through the 2
articles before posting my question. Actually my main intention is to
connect to a remote SQL Server 2005 dataabse from my local SSMS but am
not able to do so inspite of following all the steps that have been
stated in the 2 articles (& numerous other articles as well). I even
tried telnetting to the remote SQL Server but it generates an error
saying that "could not open port 1433".

This is the reason why I want to connect to my local SQL Server 2005
DB from the remote web server which is why I need the ConnectionString
to connect to my local SQL Server DB from the remote web server. As
such, to connect to my local SQL Server 2005 DB from my local web
server, I use the following ConnectionString in ASP.NET pages:

sqlConn = New SqlConnection("Data Source=RON\SQLEXPRESS;Initial
Catalog=MyDB;Integrated Security=True")

But the above won't work with the ASP.NET pages in the remote web
server. I have gone through the ConnectionStrings at www.connectionstrings.com
but couldn't find anything relevant.

Could you please help me out with the ConnectionString?

Thanks,

Ron
Do you have any firewalls, on your computer, between your computer and
the network, or between the network and the server?

Are your computer on the same local network as the server? Otherwise you
have to specify your IP address in the connection string instead of the
computer name "RON".

If you get a local IP adrress by DHCP, you can browse to a site like
http://www.whatismyip.com/ to get your external IP address.

--
Göran Andersson
_____
http://www.guffa.com
Aug 20 '08 #6

P: n/a
RN1
On Aug 20, 8:33*pm, Göran Andersson <gu...@guffa.comwrote:
RN1 wrote:
On Aug 20, 6:39 pm, Göran Andersson <gu...@guffa.comwrote:
RN1 wrote:
Is it possible to connect to my local SQL Server 2005 database from a
remote web server? If yes, what ConnectionString do I use?
Thanks,
Ron
This should be helpful:
How to configure SQL Server 2005 to allow remove connections:http://support.microsoft.com/default...b;EN-US;914277
How to configure Express to accept remote connections:http://blogs.msdn.com/sqlexpress/arc...05/415084.aspx
--
Göran Andersson
_____http://www.guffa.com
Thanks Goran for the prompt response. I had already gone through the 2
articles before posting my question. Actually my main intention is to
connect to a remote SQL Server 2005 dataabse from my local SSMS but am
not able to do so inspite of following all the steps that have been
stated in the 2 articles (& numerous other articles as well). I even
tried telnetting to the remote SQL Server but it generates an error
saying that "could not open port 1433".
This is the reason why I want to connect to my local SQL Server 2005
DB from the remote web server which is why I need the ConnectionString
to connect to my local SQL Server DB from the remote web server. As
such, to connect to my local SQL Server 2005 DB from my local web
server, I use the following ConnectionString in ASP.NET pages:
sqlConn = New SqlConnection("Data Source=RON\SQLEXPRESS;Initial
Catalog=MyDB;Integrated Security=True")
But the above won't work with the ASP.NET pages in the remote web
server. I have gone through the ConnectionStrings atwww.connectionstrings.com
but couldn't find anything relevant.
Could you please help me out with the ConnectionString?
Thanks,
Ron

Do you have any firewalls, on your computer, between your computer and
the network, or between the network and the server?

Are your computer on the same local network as the server? Otherwise you
have to specify your IP address in the connection string instead of the
computer name "RON".

If you get a local IP adrress by DHCP, you can browse to a site likehttp://www.whatismyip.com/to get your external IP address.

--
Göran Andersson
_____http://www.guffa.com- Hide quoted text -

- Show quoted text -
>Are your computer on the same local network as the server?
No
>Otherwise you
have to specify your IP address in the connection string instead of the
computer name "RON".
>If you get a local IP adrress by DHCP, you can browse to a site like
http://www.whatismyip.com/ to get your external IP address.
I don't get a local IP address by DHCP (I figured this out by running
the command - ipconfig /all - & the output showed that it is not DHCP
enabled). I browsed to www.whatismyip.com & I used the IP address it
generated instead of "RON" in the ConnectionString but I still
couldn't make the ASP.NET page residing in the remote web server
connect to my local SQL Server. It generated an error saying "Error
locating Server/Instance specified".

I also browsed to http://www.chamisplace.com/asp/info.asp?f=ip to
cross-check the IP generated by whatismyip.com but the former
generated the same IP address as the latter.

What could be the problem now?

Thanks,

Ron
Aug 21 '08 #7

P: n/a
"RN1" <rn**@rediffmail.comwrote in message
news:bd**********************************@n33g2000 pri.googlegroups.com...
Is it possible to connect to my local SQL Server 2005 database from a
remote web server? If yes, what ConnectionString do I use?

Thanks,

Ron
What is your local IP address? If it's 192.x.x.x or similar, it won't work.
That's an internal network address. Are you at home? Do you go through
Comcast or a similar ISP? Probably won't work either. From the remote
machine, at a minimum, it will need to be able to ping your IP. Your SQL
instance needs to be on a hosted server with a public-facing IP address.
Aug 21 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.