Link to home
Start Free TrialLog in
Avatar of Sokella
SokellaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Trying to change the Database Connection in IIS 6 website

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
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sokella

ASKER

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.
Avatar of Sokella

ASKER

It was a security issue in the connection string - many thanks :-)