There are 5 parts in this project and this is 3rd Part.
PART 3:
PART 1. EF – New Database First Overview
PART 2. Start a New ASP.NET MVC Project
PART 3.Create New Database and Table for EF
PART 4. Install Entity Framework and Create Entity Data Model
PART 5. CRUD Operation using Entity Framework 6
PART 2. Start a New ASP.NET MVC Project
PART 3.Create New Database and Table for EF
PART 4. Install Entity Framework and Create Entity Data Model
PART 5. CRUD Operation using Entity Framework 6
Step 1:
Create Database LibraryDB. Open Server Explorer in Visual Studio. Go to View > Server Explorer.
Step 2:
Right Click on Data Connections and click on Create New SQL Server Database.
Step 3:
Give Server Name as follows and Create Database
LibraryDB
.Step 4:
Add a New Table BookDetails in the database. Expand LibraryDB in server explorer and right click on Tables and click on Add New Tables.
Step 5:
Create a table as mentioned in picture. After designing table click on Update button to save it into the database.
Step 6: SQL Script
CREATE TABLE [dbo].[BookDetails] ( [Id] INT NOT NULL PRIMARY KEY IDENTITY, [BookName] NVARCHAR(50) NULL, [Price] NVARCHAR(50) NULL, [Category] NVARCHAR(50) NULL, [AuthorName] NVARCHAR(50) NULL, [Edition] NVARCHAR(50) NULL, [BookCondition] NVARCHAR(50) NULL, [Available] NCHAR(10) NULL )
Summary:
In this chapter, you created SQL Database and a Table. In the next chapter, we will Install Entity Framework and Create Data Model.