Solved

Provide remote SQL server access to local IIS app

Posted on 2011-09-20
4
239 Views
Last Modified: 2012-05-12
I have a couple WindowsServer08 R2 (both running same IIS/SQL versions) within my VPN. I'm looking for a connection string that will access the db on the other machine. I have the connection working via MSSMS but not via IIS.

I'm editing my web.config's db connection property to point at the remote sql server expecting that if i use the same 'computerName' property that I see from MSSMS my web app should gain access.

Here's the connectionString's properties - should I be including other properties to ensure I connect the same way MSSMS is connecting?

<add name="dbConnection" connectionString="
	Data Source=myRemoteName\SQLEXPRESS;
	Initial Catalog=myDb;
	Persist Security Info=True;
	User ID=foo;
	Password=bar
" />

Open in new window


0
Comment
Question by:juststeve
4 Comments
 
LVL 13

Expert Comment

by:itgroove
ID: 36571477
Hey there,
I'm not a SQL Connection string expert but I've found I don't need to be with this website: http://www.connectionstrings.com/

Basically, pick the technology from the page and it will help you form your connection string.
Hope it helps.
0
 
LVL 20

Accepted Solution

by:
Marten Rune earned 250 total points
ID: 36571822
is MSSMS = SSMS i e SQL Server Management Studio?

If so is it this connection thats working, then it can utilize for example named pipes.

try to add tcp: in your connectionstring in SSMS, it will pinpoint if TCP is working, or if SSMS is using named pipes and you didn't know it.

like:
tcp:NameOfTheServer\sqlexpress

Regards Marten
0
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 36573075
Please give premissions to IIS use for SQL Server.
0
 

Author Closing Comment

by:juststeve
ID: 36948236
thx
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

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

20 Experts available now in Live!

Get 1:1 Help Now