Configure connectionString using EF Database First

1

I am working with ASP NET MVC5 and I have a mini project that I want to publish in the hosting service that offers link the problem is that when I publish the pagina launches the following exception when I try to log in and therefore access the database.

The problem is when I change my connectionString, which I have by default, and works locally for the one that provides me with some.

My connectionString locally is:

<add name="RossetHotelEntities3" connectionString="metadata=res://*/Models.DB.RossetHotel.csdl|res://*/Models.DB.RossetHotel.ssdl|res://*/Models.DB.RossetHotel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=CRACK81-PC;initial catalog=RossetHotel;persist security info=True;user id=sa;password=francia1998;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

The one I use when I try to publish in somee is:

 <add name="RossetHotelEntities3" connectionString="metadata=res://*/Models.DB.RossetHotel.csdl|res://*/Models.DB.RossetHotel.ssdl|res://*/Models.DB.RossetHotel.msl;provider=System.Data.SqlClient;provider connection string=&quot;'workstation id=RossetHotel.mssql.somee.com;packet size=4096;user id=login;pwd=password;data  source=RossetHotel.mssql.somee.com;persist security info=False;initial catalog=RossetHotel'&quot;" providerName="System.Data.EntityClient" />
    
asked by crack81 05.12.2016 в 03:37
source

1 answer

1

The second connection string you use has invalid characters (single quotes'), delete them from the string and it should work.

<add name="RossetHotelEntities3" connectionString="metadata=res://*/Models.DB.RossetHotel.csdl|res://*/Models.DB.RossetHotel.ssdl|res://*/Models.DB.RossetHotel.msl;provider=System.Data.SqlClient;provider connection string=&quot;workstation id=RossetHotel.mssql.somee.com;packet size=4096;user id=login;pwd=password;data  source=RossetHotel.mssql.somee.com;persist security info=False;initial catalog=RossetHotel&quot;" providerName="System.Data.EntityClient" />
    
answered by 08.12.2016 в 16:18