Samer Allahham
Samer Allahham

Reputation: 76

ASP.NET MVC EF Connection String On Somee.com

My connection string on local host is

<connectionStrings>
    <add name="DbModels" 
         connectionString="metadata=res://*/Models.DbModels.csdl|res://*/Models.DbModels.ssdl|res://*/Models.DbModels.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\MSSQLLocalDB;attachdbfilename=C:\Users\mcc\Documents\consultations.mdf;integrated security=True;connect timeout=30;MultipleActiveResultSets=True;App=EntityFramework&quot;" 
         providerName="System.Data.EntityClient" />
</connectionStrings>

and it's working just fine.

But when I deployed my website to somee.com and tried to update the connection string in the web.config, I failed to get it to work

somee connection string is this:

workstation id=Consultations.mssql.somee.com;packet size=4096;user id=Samer_61122_SQLLogin_1;pwd=///;data source=Consultations.mssql.somee.com;persist security info=False;initial catalog=Consultations

I need to know how should be the proper connection string to work

Upvotes: 1

Views: 963

Answers (1)

koding
koding

Reputation: 165

Create your database in somee.com, site will generate a connection string like this:

workstation id=xxxx.mssql.somee.com;packet size=4096;user id=yyyy_SQLLogin_1;pwd=zzzz;data source=xxxx.mssql.somee.com;persist security info=False;initial catalog=xxxx

Try like this for EF:

metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=xxxx.mssql.somee.com;initial catalog=xxxx;persist security info=True;user id=yyyy_SQLLogin_1;password=zzzz;MultipleActiveResultSets=True;App=EntityFramework"

Upvotes: 1

Related Questions