Q: create database before start programming by asp.net mvc 5? I'm trying to learn MVC 5 and I have problem to connect to my database (SQL Server) I searched and find some solution but didn't work for me. So I want to know I have to create a database, a table and diagrams first, before I start to programming Asp.Net MVC 5 web application?

A: You can connect to your SQL Server using SQL Server Management Studio and create a database and a user for your application.
You then add the correct connection string an put it in your web.config. This depends heavily on your database setup. Here is a basic example (you need to at lease fill in Servername, UserId and Password):
<add name="ConnectionStringName"
providerName="System.Data.SqlClient"
connectionString="Data Source=ServerName;Initial Catalog=DatabaseName;Integrated Security=False;User Id=userid;Password=password;MultipleActiveResultSets=True" />

More options can be found in the Documentation

A: If you use one of the CRUD templates, the database will be created through Entity Framework for you locally. If it's not connecting to the generated database, you can try the following code in the Application_Start method:
protected void Application_Start()
{
    System.Data.Entity.Database.SetInitializer(new DropCreateDatabaseIfModelChanges<schoolcontext>());
    using (var context = new SchoolContext())
    {
        context.Database.Initialize(force: true);
    }
}

