0

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 ?

Hizu'
  • 21
  • 5
  • Could you give us some code? also the connectionString you using? – Zorkind Dec 12 '17 at 13:38
  • Temporarily, for testing only, set your windows account to the account that the application pool is running under and see what happens. In the meantime, add the exception details you are getting to your question as an edit. – Crowcoder Dec 12 '17 at 13:48

1 Answers1

0

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.

RedNet
  • 416
  • 5
  • 12