Link to home
Start Free TrialLog in
Avatar of n2dweb
n2dwebFlag for United States of America

asked on

DB Connection string using an IP address and DB instance name

I have an application that is used on 2 computers:
appComputer (177.16.177.340) & devComputer (177.16.177.341).
I use a file named AppSettings.xml to set the connection string.
The app computer only has 1 database instance so I used the IP address:
<ConStringX>Database=Clients; Server=177.16.177.340;Uid=This;Pwd=That;</ConStringX>
and it works great.
On the DevComputer I use the computer name and the instance name:
<ConStringX>Database=Clients; Server=DevComputer\Demo;Uid=This;Pwd=That;</ConStringX>
This works as long as I am running the application on the DevComputer.

I  have to be able to run the application from a different server pointing back to where the DB is located.
So how do I change the connection string to use the IP address (177.16.177.341) and the instance name (Demo)

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Om Prakash
Om Prakash
Flag of India 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
Above solution might give an error.
Try:
Use just the IP address and not the instance name (177.16.177.341)
Also make sure the "SQL Agent" is running on the box you're trying to connect.
Avatar of n2dweb

ASKER

I think this may have solved it. (I had the wrong slash). I have to redeploy DBs to test it - I will let you know soon if it fixed it- thanks