Reputation: 21
I have an application ASP.net MVC in local. I'm working with VisualStudio 2017 and IIS Express and SQL Server Express. I have try to put my project on IIS local on my computer. My application can be execute on my browser but I can't make some request with my SQL Server Express since my code is on IIS. I think SQL Server Express need some parameters but I don't find them.
My connection string is :
this.Database.Connection.ConnectionString = "Server=" + NameServer + "; Database=" + NameDatabase + "; Integrated Security = true";
I use localDB Sql Server Express I don't know if it's a problem If you have some ideas ?
Upvotes: 0
Views: 693
Reputation: 52
What error is being thrown at you?
Have you tried copy-pasting the connection string directly from SQL Server to your Web.config file? Also since you're in the testing phase make sure the user you're trying to login with exists in the SQL server.
Make sure the connection string exists in Features tab of your web app on IIS.
Try replacing your connection string with
this.Database.Connection.ConnectionString = "Server=" + NameServer + "; Database=" + NameDatabase + "; Integrated Security = SSPI";
SSPI and true might seem similar but they're not the same, see this answer for a more detailed explanation.
Upvotes: 0