See the following Steps:
Step 1: Open Visual Studio 2010, Go to the New Project, then Visual C#, Web and select ASP.NET MVC Web Application. After that click OK.
Step 2: After clicking OK, new ASP.NET MVC5 project window will open and there you have you chose MVC and press OK.
Step 3: After clicking OK, you will see something like the following image in your Solution Explorer. You need to look out for Model, Controller and View folders that are the main files in MVC, others are too but these are main files.
Database chamber:
Step 4: Right click on your Project, Add New Item, SQL Server Database and add it. Go to your Database, resides in Server Explorer [Database.mdf], we will create a table Student. Go to the Student Table and Add New table. Design your table like the following:
Show Table Data:
In Model
Step 5: Right Click on Models, Add New Item, then Add ADO.NET Entity Data Model and Name it Student.edmx, then ADD it.
In Controller
Step 6: Right Click on Controller and Add Controller. You have to chose MVC5 Controller with Views using Entity Framework and ADD it.
Fill up the necessary model name and data context class name and add it, when you hit add, you will see, under view folder there is another folder created name – “Student” and four method created to perform – “CRUD”.
Inside View Folder-
Student Controller.cs:
Output Here you can create, edit , delete or update the data – Try it.