Advertisement

04.16.2008 at 10:52PM PDT, ID: 23329863
[x]
Attachment Details

unable to connect ASP to SQL 2005 database through web.config

Asked by m_hudson in WebApplications, Microsoft IIS Web Server, Programming for ASP.NET

Tags: ASP, ASP.net 2.0

Ok, so our company decided to move our hosting from external to internal to save costs. I have attached the SQL database to our sql server(MSSQL2005), and placed the ASP 2.0 code on our web server(win2003R2 with IIS). I get the following error:

An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Now what i did was go to the properties of the web config through the IIS and set the connection string like this;
Key
connectionString=server=SQLServername\InstanceName;uid=Username;pwd=Password;database=DatabaseName

This did nothing, then I noticed this.
LocalSqlServer=data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true

I know basic coding but this throws me completely. Is this a file I am suppose to have?  If not, can anyone please help me get this website up? I am completely lostStart Free Trial
[+][-]04.17.2008 at 12:14AM PDT, ID: 21374821

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.17.2008 at 12:15AM PDT, ID: 21374825

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.17.2008 at 12:18AM PDT, ID: 21374837

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: WebApplications, Microsoft IIS Web Server, Programming for ASP.NET
Tags: ASP, ASP.net 2.0
Sign Up Now!
Solution Provided By: logudotcom
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.17.2008 at 12:19AM PDT, ID: 21374845

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.17.2008 at 12:26AM PDT, ID: 21374870

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628