Skip to main content

Posts

Showing posts from June, 2022

Asp.net MVC 5 Entity Framework :- CRUD Operations Sample Code

Asp.net MVC 5 Entity Framework:- CRUD Operations Project Sample Code Step 1.Create Database using MSQL Server Database (SQL) Code:- /****** First Execute this Command ******/ Create Database [EntityFrameworkSampleDB] /****** Create Tables  ******/ Use EntityFrameworkSampleDB; CREATE TABLE [dbo].[Branch]( [BranchID] [bigint] Primary key IDENTITY(1,1) NOT NULL, [BranchName] [nvarchar](50) NULL, [Location] [nvarchar](50) NULL ) CREATE TABLE [dbo].[Department]( [DeptID] [bigint] Primary Key IDENTITY(1,1) NOT NULL, [DeptName] [nvarchar](50) NULL ) CREATE TABLE [dbo].[Employee]( [EmployeeID] [bigint] Primary Key IDENTITY(1,1) NOT NULL, [Name] [nvarchar](50) NULL, [Designation] [nvarchar](50) NULL, [Contact] [nchar](10) NULL, [Email] [nvarchar](50) NULL, [City] [nvarchar](50) NULL, [Salary] [decimal](18, 2) NULL, [JoiningDate] [datetime] NULL, [DeptID] [bigint] references Department(DeptID) on Delete set NULL, [BranchID] [bigint] references Branch(BranchID) on Delete ...