I'm getting a File Access Denied error when I try to add a SQL Server .mdf file to an ASP.Net project RRS feed

  • Question

  • User610095381 posted

    I've created a new ASP.Net Dynamic Data Entities Website project in ASP.Net 2013.  I'm trying to add a SQL Server 2008 database called Pubs, downloaded from Microsoft, to my project in the app_data folder.  I right click the folder icon in the solution explorer, choose Add Existing object, navigate to the Pubs.mdf file, and select that.  I then get a Access Denied message box.  What can I do to allow access for ASP.Net to this file?

    Tuesday, July 8, 2014 10:16 AM


  • User-1454326058 posted

    Hi ScottBrush,

    Please refer to these steps below:

    1. Copy that database file to other folder (E.g. D:\\database)
    2. Right click it=>Properties
    3. Select Security tab and configure it

    On the other hand, you could copy that database file to the App_Data folder directly by using file explorer. (Do not add it to the solution)


    Best Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 9, 2014 2:05 AM