Question

We are currently looking to migrate servers, however we need to for the time being allow the live website to use the external database on the new server.

Currently the string used to connect to the local server looks like this:

Provider=SQLNCLI10;Password=Rave123;Persist Security Info=True;User ID=Usr123;Initial Catalog=sqldb12;Data Source=.\SQLEXPRESS

However I need to amend this to use an IP Address to direct it to use the external server.

I've attempted a number of different solutions but none work, please can you advise me on how to do this based on the system.

The system is IIS 7 and it's a Windows Server 2008 with SQL Server Express Edition.

Please use my details as above for the example query so it makes sense to me :)

Was it helpful?

Solution

The connection string should be:

Provider=SQLNCLI10;Password=Rave123;Persist Security Info=True;User ID=Usr123;Initial Catalog=sqldb12;Data Source=<IP address>

Or if it is a named instance:

Provider=SQLNCLI10;Password=Rave123;Persist Security Info=True;User ID=Usr123;Initial Catalog=sqldb12;Data Source=<IP address>\<instance name>;

So if it is SQLExpress as a named instance:

Provider=SQLNCLI10;Password=Rave123;Persist Security Info=True;User ID=Usr123;Initial Catalog=sqldb12;Data Source=<IP address>\SQLExpress
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top