Last post Jul 10, 2020 12:30 PM by PatriceSc
Jul 10, 2020 08:53 AM|Deepulu1984|LINK
I tried to host my mvc app using entity framework on the server.
There is a problem with the connection string.
on my developer machine it was
<add name="myDBEntities" connectionString="metadata=res://*/myEDM.csdl|res://*/myEDM.ssdl|res://*/myEDM.msl;provider=System.Data.SqlClient;provider connection string="data source=DESKTOP-xxxxxx;initial catalog=myDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
After hosting , I changed this to
<add name="myDBEntities" connectionString="metadata=res://*/myEDM.csdl|res://*/myEDM.ssdl|res://*/myEDM.msl;provider=System.Data.SqlClient;provider connection string="data source=xxxxxxxx;initial catalog=myDB;User ID=userid;password=pwd;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"providerName="System.Data.EntityClient" />
The datasouce , userid and password are entered correctly, as I tried to connect from Management Studio SQL and it was sucessful.
But when tried to change the connection string in web.config file of server , it shows 500 internal server error.
What is that Im missing? Is my changed connection string correct? please help
Jul 10, 2020 09:04 AM|PatriceSc|LINK
If using a user id and password remove the "Integrated Security=True" part from your connection string.
http 500 means you have a server side error. your hosting service should likely log those messages somewhere so that you can access them...
Jul 10, 2020 10:31 AM|Deepulu1984|LINK
tried but didnot work.
datasource =server number generated when database was created on server.
usename= myuser (created when database was created on server)
password=mypwd (created when database was created on server)
Removed Integrated Security=True
These are the changes made in my connectionstring in both web.config files. still not working
Jul 10, 2020 11:19 AM|mgebhard|LINK
There really is not much forum members can do if you do not know your connection string fields.
All you need is the database server, database name, and credentials. Usually, you can get this information by logging into your hosting account. Once you have the database connection info you can use Visual Studio to connect (or SSMS) to connect to the
DB. In Visual Studio just click the View dropdown menu and select SQL Server object Explorer. Then make a new connection with the connection info from your account. Once you connect, then you can copy the connection string from the properties window.
It's a different story if you did not create a database. Anyway, connect your host for assistance.
Jul 10, 2020 12:30 PM|PatriceSc|LINK
So if the quick guess doesn't work it would be mcuh better to get the exact error message. Do you have access to some logs ? Usually :
- by default 500.0 are exceptions which should be written to the event log and likely made available somewhere by your hosting server
- if not finding anything I would look at the web server log (for example 500.19 is a problem wtih the config file)