views:

491

answers:

1

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=&quot;
    Data Source=localhost;
    Initial Catalog=InmarsatZenith;
    Integrated Security=True;
    MultipleActiveResultSets=True&quot;" 
    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=&quot;
Server=tcp:MYSERVER.ctp.database.windows.net;
Database=InmarsatZenith;
UserID=MYUSERID;Password=MYPASSWORD;
Trusted_Connection=False;
MultipleActiveResultSets=True&quot;" 
providerName="System.Data.EntityClient" />

The Question

Anyone know if this connection string for SQL Azure is correct? Help greatly appreciated.

A: 

Just remove this bit ;MultipleActiveResultSets=True and you are done.

For your For your convenience I have already done it for you. Just copy and paste.

<add name="InmZenEntities" connectionString="metadata=res://*/InmZenModel.csdl|res://*/InmZenModel.ssdl|res://*/InmZenModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Server=tcp:MYSERVER.ctp.database.windows.net;Database=InmarsatZenith;UserID=MYUSERID;Password=MYPASSWORD;Trusted_Connection=False&quot;" providerName="System.Data.EntityClient" />
Supremestar
If it works for you (it is working for me), please mark this as an answer. Thanking you.
Supremestar