Solved

SQL Server 2008 | Remote Connection String

Posted on 2014-03-03
5
551 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
[X]
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
  • 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 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