Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SQL Server 2008 | Remote Connection String

Posted on 2014-03-03
5
543 Views
Last Modified: 2014-03-06
Hi experts,

I have an SQL server 2008 on a remote server that I want to connect my local ASP.NET website to.
I copied the same local database files from my local SQL server 2005 to the remote SQL server 2008 and attached them.
The remote SQL server 2008 is on windows authentication while the local is on mixed.
I have the IP, but I am getting an error using the below connection string:

<add name="SiteSqlServer" connectionString="Server=<ip address>;Database=AIIIP;Trusted_Connection=Yes;" providerName="System.Data.SqlClient" />

1.      Is there any additional thing that I missed?
2.      Is it recommended that I user windows authentication on an sql sever that is being used for a website?

Thanks,
0
Comment
Question by:feesu
  • 3
  • 2
5 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39899922
what error do you get?
you may need to specify the port.
is the windows account created in the remote sql server in the logins?
apart from that, see this article to start troubleshooting
http://www.experts-exchange.com/Database/MS-SQL-Server/A_1881-Connect-to-your-SQL-Server.html
0
 

Author Comment

by:feesu
ID: 39900040
first of all, the remote server is within our network so it's the same domain.

the error says login failed for "domain/user".

do i need to give permissions to my user on that server? but then when i migrate my local website to the actual webserver, i will need to give permission to the webserver's user on the sql server machine! is that ok from a website security perspective? what's the best practice?
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 39900072
>do i need to give permissions to my user on that server?
yes. "windows authentication" will not implicitly create logins in your sql server for "all" windows accounts. that would be not secure at all, as how should sql server know what permissions the windows account should have?

the only "secure" point about is that the password is not stored by sql server, but by the windows domain.

so, if you are in the context of a web server, unless all users are inside the domain, so that you will be able to use indeed the windows authentication even directly from the web page, you will need to created the web service's login the permissions on the sql server
0
 

Author Comment

by:feesu
ID: 39900239
you mean the web services' login will allow the sql server permission for the website whether it runs on my local PC or on another server?
0
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 500 total points
ID: 39900243
if both web services use the same login, yes
this is a nice article about setting up IIS and SQL Server in terms of logins/security:
http://www.codeproject.com/Articles/674930/Configuring-IIS-ASP-NET-and-SQL-Server
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question