1

Note: This is different from Cant find my EF code first database He didn't specify the initialCatalog while I did as you will see:

I have 3 CodeFirst DBs that I work with. 1 I create and use in my visual studio project when I hit F5 1 I host in Azure with test users. If I want to update it, I simply remove it and recreate it by publishing my VS project 1 that is somewhere in my localDB, hosting it in my IIS in my machine, which is my issue. I can't find it! I don't know where CodeFirst places it. But I can access the website which somewhat brings records from it! Please help me find it. Here is my entire setup: in my publishing profile for the Local: enter image description here enter image description here

lets call the blacked out "ProjAPIContext"

and in my IIS

enter image description here

and the www root folder is simple. The AppData folder is always empty: enter image description here

and I have this in my web.config

<connectionStrings>
    <add name="ProjAPIContext" connectionString="Data Source=(localdb)\v11.0; Initial Catalog=ProjAPIContext; Integrated Security=True; MultipleActiveResultSets=True; AttachDbFilename=|DataDirectory|ProjAPIContext.mdf" providerName="System.Data.SqlClient" />
</connectionStrings>

the context matches what is in code:

internal sealed class Configuration : DbMigrationsConfiguration<ProjAPI.Models.ProjAPIContext>

That's my setup. I am looking for the DB so I can navigated through table rows and run sql queries against it, etc... I have looked my entire harddrive with that ProjAPIContext. I see other DB created with the same times frame like tempdb and masterdb but they can't be those. I have attach the debugger to connect to my server code in my visual studio, but nothing hit. I've run the profiler in my sql, it doesn't print the connection string. It prints useless junk.

UPDATE #1: I also looked here: enter image description here

Update#2: of course I've looked there: enter image description here

Where else should I look!?

Community
  • 1
  • 1
user1019042
  • 2,428
  • 9
  • 43
  • 85
  • 2
    Possible duplicate of [Cant find my EF code first database](http://stackoverflow.com/questions/35982552/cant-find-my-ef-code-first-database) – Salah Akbari Oct 16 '16 at 20:09
  • Or this http://stackoverflow.com/questions/37059044/sql-server-object-explorer-not-showing-a-database?noredirect=1&lq=1 – Salah Akbari Oct 16 '16 at 20:10
  • both are not the same. Check my note at the top and Update #1 – user1019042 Oct 16 '16 at 20:18
  • It is probably in your SQL Server Object Explorer or a mdf file in your project (and recreated on each compile) – Thomas Andreè Wang Oct 16 '16 at 20:24
  • @ThomasAndreèLian of course I've checked there. I added an image to show in Update#2 – user1019042 Oct 16 '16 at 20:33
  • @user1019042 that is object explorer then server explorer – Thomas Andreè Wang Oct 16 '16 at 20:34
  • can u use more words to explain pls? are you talking about different object explorer? – user1019042 Oct 16 '16 at 20:36
  • http://stackoverflow.com/questions/12187068/where-is-datadirectory-defined – Thomas Andreè Wang Oct 16 '16 at 20:37
  • if it is not located at |DataDirectory|ProjAPIContext.mdf as specified in your connection string then it is deleted, this is common, you need to add it to a solid location outside your program folder. or even better add a SQL server lite instance. – Thomas Andreè Wang Oct 16 '16 at 20:39
  • Try to connect as in your update#1 but in the combo Server Name enter `(localdb)\v11.0`. You can also try to select the value `Microsoft SQL Server Database File` in the Data Source input control. This is not exactly a SQL Server Express database but a Visual Studio development database. – Diana Nov 04 '16 at 02:10

0 Answers0