Solved

SQL Server 2008 | Remote Connection String

Posted on 2014-03-03
5
524 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 142

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 142

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 142

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now