Reputation: 76
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="data source=(LocalDB)\MSSQLLocalDB;attachdbfilename=C:\Users\mcc\Documents\consultations.mdf;integrated security=True;connect timeout=30;MultipleActiveResultSets=True;App=EntityFramework""
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
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