Convert ADO.Net EF Connection String To Be SQL Azure Cloud Connection String Compatible!?
Posted
by Goober
on Stack Overflow
See other posts from Stack Overflow
or by Goober
Published on 2009-10-09T10:47:38Z
Indexed on
2010/04/09
5:43 UTC
Read the original article
Hit count: 376
The Scenario
I have written a Silverlight 3 Application that uses an SQL Server database. I'm moving the application onto the Cloud (Azure Platform). In order to do this I have had to setup my database on SQL Azure. I am using the ADO.Net Entity Framework to model my database. I have got the application running on the cloud, but I cannot get it to connect to the database. Below is the original localhost connection string, followed by the SQL Azure connection string that isn't working. The application itself runs fine, but fails when trying to retrieve data.
The Original Localhost Connection String
<add name="InmZenEntities"
connectionString="metadata=res://*/InmZenModel.csdl|res://*/InmZenModel.ssdl|res://*/InmZenModel.msl;
provider=System.Data.SqlClient;
provider connection string="
Data Source=localhost;
Initial Catalog=InmarsatZenith;
Integrated Security=True;
MultipleActiveResultSets=True""
providerName="System.Data.EntityClient" />
The Converted SQL Azure Connection String
<add name="InmZenEntities" connectionString="metadata=res://*/InmZenModel.csdl|res://*/InmZenModel.ssdl|res://*/InmZenModel.msl;
provider=System.Data.SqlClient;
provider connection string="
Server=tcp:MYSERVER.ctp.database.windows.net;
Database=InmarsatZenith;
UserID=MYUSERID;Password=MYPASSWORD;
Trusted_Connection=False;
MultipleActiveResultSets=True""
providerName="System.Data.EntityClient" />
The Question
Anyone know if this connection string for SQL Azure is correct? Help greatly appreciated.
© Stack Overflow or respective owner