Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7593949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:17:55+00:00 2026-05-30T21:17:55+00:00

My database is stored in an .mdf in App_Data and is functioning fine. My

  • 0

My database is stored in an .mdf in App_Data and is functioning fine. My application can add, edit, delete records.

But the tables are invisible. When I open the Server Explorer and attach my .mdf and try to view the tables, there are none listed there. I attached the file to SQL Server Management Studio as well, but the only tables that show up there are those in the folder System Tables.

From what I’ve been able to glean from the technobabble on MSDN this could be a permissions or ownership issue. I don’t know about permissions, given that I’m able to connect to the database and query it and edit/delete records. So maybe ownership; I read somewhere that tables not owned by dbo may not show. But if that’s the case, I don’t know what my application’s ownership name is or how to make Management Studio or even Server Explorer show tables owned by other users.

Here’s the connection string, in case the answer’s in there:

<add name="EFDBContext" connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=|DataDirectory|MLDatabase.mdf;Database=EFDbContext;User Instance=true" providerName="System.Data.SqlClient"/>

Thanks to anyone who might point me in the right direction!

ETA. this seems like a similar issue, but I don’t know if the solution there would apply, since my database wasn’t generated by scripts but by the Entity Framework (Code-First model).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:17:56+00:00Added an answer on May 30, 2026 at 9:17 pm

    The reason the tables weren’t showing up is because they were not in the .mdf, of course. As I noted in a comment, I found them elsewhere, in a location chosen by SQL Server.

    A workaround is to just let EF build the SQL Server database where it wants, stop the SQL Server service, move it to the App_Data folder, change the connection string appropriately, and then attach it to the ASP.NET project.

    Another issue is that SQL Server’s Network Service does not have permission to do anything in the C:\Users\Me folder, or the Documents and Settings folder, until you go to that folder and assign permission to the Network Service directly. Then and only then will you be able, for instance, to attach the database to the SQL Server Management Studio. This is true even when Visual Studio installs SQL Server… and then denies it permission to access the files where VS keeps it’s own projects. I don’t get it; IMO any developer who’s aware of this, the first thing she is going to do, just in order to get her work done, is to give Network Service that permission anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I host an application in Windows Azure and have the database stored on
I noticed a number of cases where an application or database stored collections of
- init { if(![super init]) return nil; //the database is stored in the application
I have an SQLite database stored in the assets resources of one application used
I have sql database stored on a shared netwrok drive , after set of
I've got an MS-Access database stored in a folder (yes, I have 'Modify' permissions
I have a very odd issue. When I execute a specific database stored procedure
Our database schema is stored in a single file that is intended for production
For a large database (thousands of stored procedures) running on a dedicated SQL Server,
I have a setting stored in database which has a value .jpg|.gif|.png . I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.