2
votes

Ok so i know I'm fairly new to C# and MVC but I'm trying to use the code first approach of adding items to a database.

Now I have successfully created new entries to the database but when I go to SQL Server i cannot find the database or tables.

So my question is where is this data being stored as I can't see it in SQL Server like my other databases that I manually created?

My ConnectionString is:

Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-Testing-20140809020449.mdf;Initial Catalog=aspnet-Testing-20140809020449;Integrated Security=True

2

2 Answers

4
votes

LocalDb is the new server-less version of SQL Server that has similar features as SQL Express. I would describe it as a just-in-time version of SQL Server that is only running when needed.

In order to connect to it usng SQL Server Management Studio, you need to connect using the following connection string (assming SQL Server Version 11/2014 may change to 12 or higher in future versions):

SMSS LocalDB

Then you'll have access to the database.

enter image description here

3
votes

[project_dir]\App_Data\aspnet-Testing-20140809020449.mdf