Showing posts with label webapp. Show all posts
Showing posts with label webapp. Show all posts

Wednesday, March 7, 2012

An attempt to attach an auto-named database for file

I build a WebApp which i use the default DataBase that come with the App_Data folder.

I have Users and roles into that folder with all my tables regarding my new App.

Why i cant make it work under IIS on my webserver ? When i open it with Visual Studio everything works but outside of it nothing.

An attempt to attach an auto-named database for file c:\inetpub\wwwroot\Survey\App_Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf;

I look arround and cant find a thing on how to fix my issue. I try deleting the Folder under my User Account for SQL Express and nothing happend.

Make sure your IIS account (ASPNET or NETWORK SERVICE) has read&write permission on the folder where the database file locates.|||Yes i did that ! even uers have modify to it. under that folder !|||

Im still looking for help arround here !

anybody fix the issue?

|||

It is not working because IIS is not the place to store database files, you store those in the data subfolder of Microsoft SQL Server in programs. You can modify the code in the thread below for your use. You may need to start with the trail version of SQL Server and later buy the developer edition it is under $40 on the web. Hope this helps.

http://forums.asp.net/thread/977493.aspx