Solved

Trying to change the Database Connection in IIS 6 website

Posted on 2014-03-10
3
680 Views
Last Modified: 2014-03-10
I have a website running in IIS 6 which is using a web.config file to access the database.  The connection String is this:

    <connectionStrings>
        <add name="Vision" connectionString="data source=VisionAlias; integrated security=True; initial catalog=DatabaseName; Application Name=Forcasting" providerName="System.Data.SqlClient"/>
    </connectionStrings>

This connects to a SQL Server 2005 database.

I need to change it to point to a new 2008 database.
I have tried Creating an Alias called "Forecasting" on the 2008 database, and then changing the "data Source=Forecasting;..... however it doesn't work.

I've also tried replacing it with a connection string in the format :

    <connectionStrings>
        <add name="Apple" connectionString="data source=SQLServerInstance; integrated security=True; initial catalog=DatabaseName" providerName="System.Data.SqlClient"/>
    </connectionStrings>

That doesn't work either.

Is there something else I need to change?  I have restarted IIS services after each change, and it does make a change (it breaks!), so I know I'm using the right file.  

Thanks
0
Comment
Question by:Sokella
  • 2
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 39917132
however it doesn't work.
giving some error message may help to troubleshoot.

are the same logins/permissions created on the new server?
is it enabled in terms of TCP/IP connectivity and allow remote connections?
is at also a "default" instance, or eventually a named instance?
etc ...
0
 

Author Comment

by:Sokella
ID: 39917153
OK the error message is this:

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /ForecastTool/errorPages/errorPages/applicationError.aspx

It might be the security problem - I might change the security from Trusted.
It's not a default instance, it is a named instance, and I included that in the string.
Should the full connection string work?  If so I will play with that and assume it's the security.
0
 

Author Closing Comment

by:Sokella
ID: 39917183
It was a security issue in the connection string - many thanks :-)
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

810 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