I'm trying to develop a WebService between me and my roomate (so a local one).
I created a Database (.mdf) saved in one of my folders and some aspx pages that access to it and retrieve informations. Now I was trying to deploy the project under IIS and I'm getting a problem when I have to access to the local db.
provider: SQL Network Interfaces, error: 50 Server not found or not accessible.
Everything from Web Visual Studio works fine! So if I try to connect the DB just running from VS on Google Chrome everything is fine. This error appears only when I try to run it under IIS 8.0
(my string connection = Server=(LocalDB)\\v11.0;
AttachDbFilename=C:\\Users\\Asus\\Desktop\\RobaMia\\SQLSERVER\\WindowsFormsApplication3\\WindowsFormsApplication3\\Database2.mdf;
Integrated Security=True;Connect Timeout=30;User Instance=False)
Could it be that "User Instance = False"
makes the trick?
I say also that all my application pools are user-set http://i.imgur.com/jrOZxTO.jpg
Probably your IIS Application Pool doesn't have permission to open your database file C:\\Users\\Asus\\Desktop\\RobaMia\\SQLSERVER\\WindowsFormsApplication3\\WindowsFormsApplication3\\Database2.mdf. I would suggest to change the application pool identity to your local windows user.
See this link: Using LocalDB with Full IIS, Part 1: User Profile - SQL Server Express WebLog - Site Home - MSDN Blogs
I too had the same problem.
It works for all the web api that you are testing in iis. It worked for my xamrine.android app testing only when hosted in IIS and not in Express.
I had this in my web.config. Removing it fixed the issue for me
<identity impersonate="true" /
>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.