database connection error when use IIS
Hi Imar,
I'm a beginner of ASP.NET and your book is really helpful to me,but I met a problem in chapter 19
In chapter 19,after configuring the file system,my SQL server instance name is MSSQLSERVER(as default),so I changed the connection string as follow:
connectionString="Data Source=.\MSSQLSERVER;AttachDbFilename=|DataDirecto ry|\PlanetWrox.mdf;Integrated Security=True;"
(so is the entity framework's connection string, changed the Data Source value)
but when it runs under IIS by typing localhost,it occurs an error when choose
a DB-related page,like Gig Pics:
provider: SQL Network Interfaces, error: 25 - connection string is invalid
when use VS's IIS Express to run the sites it also shows the error
so I enabled the Name Pipes and TCP/IP protocols using SQL Server Configuration Manager as Appendix,and turn off the firewall, but the error still occur, and I tried to change the Data Source value back to "(LocalDB)\v11.0", it run right when using IIS Express,but when run under IIS,it still occur that error when select some pages,so it's really confusing me(I use VS2013,data base is SQL 2012 standard edition)
Thank you
Yan
Last edited by ninevehland; May 7th, 2015 at 10:27 AM..
|