0

I tried to connect to a SQL Server database on the internet via an Asp.net application that is on my local system.

The database is on a server with IP x.x.x.x and on the server we have 3 instances of SQL Server 2005: instance1/MSSQL2005 and instance2/MSSQL2005 and instance3/MSSQL2005.

I can't connect with my application to the instance1/sqlserver2005 on the database XXX on this instance !

This its my connection string that didn't work :

<add name="VestaWSEntities" 
     connectionString="metadata=res://*/DBModel.csdl|res://*/DBModel.ssdl|res://*/DBModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;server = x.x.x.x ;Data Source=Instance1\MSSQL2005;Initial Catalog=MyDB ;User ID=sa;Password=123;MultipleActiveResultSets=True&quot;"
     providerName="System.Data.EntityClient" />

1 Answer 1

1

Your instance names don't look correct.

Usually a SQL instance is specified in the format server\instance

given the information in the question, it should be something like

x.x.x.x\instance1
x.x.x.x\instance2
x.x.x.x\instance3

Can you connect to the instances in SSMS? You should use the same value in the data source in your connection string

Try replacing this in your connection string

server = x.x.x.x ;Data Source=Instance1\MSSQL2005;

to this

Data Source=x.x.x.x\instance1;Initial Catalog=MyDB;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.