Where is the default database created for C# MVC ASP.NET application?

14,876

Solution 1

enter image description here

This will stored under Sql express that came along with visual studio 12,13 &15.

You can connect it using server explore under View - > server Explorer

Solution 2

Here is something in case you can't see the DefaultConnection and AspNet tables in Server Explorer: You need to register a user at least once to get these tables created or at least to show.

Solution 3

Default connection string will be

<connectionStrings>
    <add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />
  </connectionStrings>

So it will be created in your app data. MDF file will be created. Though you can change the connection

Solution 4

In your Web.config ,look for 'Connectionstring'

 <connectionstrings>
        <add name="ConnectionstringName" connectionstring="Data Source=DatasourceName;Initial Catalog=This_isDefault_db;Persist Security Info=True;User ID=ID;Password=pwd" providername="System.Data.SqlClient" />
    </connectionstrings>

The catalog attribute tells you which is your db.

Solution 5

Normally we connect our model or DAL to a databases like Sql Server or MySQL etc. But as per you question i understood that just you are using a visual studio built-in application. visual studio stores that data in localDB

Share:
14,876

Related videos on Youtube

Adrian
Author by

Adrian

Updated on September 16, 2022

Comments

  • Adrian
    Adrian over 1 year

    I've got new MVC ASP.NET app on bootstrap with login/register script and it works ok, but I don't know where is default database for this app. My App_Data folder is empty. Can somebody tell me where the data from form registration are saved.