The connection string generated by entity framework looks like this.
<add name="ETestEntities" connectionString="metadata=res://*/Models.TestModel.csdl|res://*/Models.TestModel.ssdl|res://*/Models.TestModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=bogus\sqlexpress;Initial Catalog=ETest;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
I ftp deployed the application, created the database(i named it ETest) and created an user.
The instruction i got is:
In order to connect to SQL Server 2008 from Management Studio, Enterprise Manager, Query Analyzer or other client software you can use the following SQL Server address:
1.2.3.4
You may also use SQL Server address above in your application connection strings, for example:
Classic ASP (ADO Library) Provider=SQLOLEDB;Data source=1.2.3.4;Initial catalog=databaseName;User Id=userName;Password=password;
ASP.NET (ADO.NET Library) Server=1.2.3.4;Database=databaseName;Uid=userName;Password=password;
I tried the following from http://www.connectionstrings.com
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;
How do i have to modify the connection string to make it work?
It seems to work like this:
Connection string: Data Source=dataSource;Network Library=dbmssocn;Connection Timeout=15;Packet Size=4096;Integrated Security=no;User ID=user;Password=pass;Encrypt=no;
Connection timeout: 15
Database: ETest
Datasource: dataSource
Network packet size: 4096
Server version: 10.00.4311
Work station id: WIN-HS1ITVC2D4K
With Entity Framework there is an extra abstraction1 going on. The connection string generated for you, with a couple of added line breaks:
can be seen to contain a
provider connection stringproperty, the value of this property is the “normal” connection string (undoing the XML escapes):You need to replace the value of the
Data SourceandInitial Catalogproperties of this inner connection string.1 Essentially the EF connection string is telling the EF runtime where to get the model (from resources in an assembly) to create the in-memory model, what EF provider to use, and what connection string to pass to that provider – and it is this last piece that you need to adjust when the server, instance or database changes.