In this repository I have perfomred CRUD Operations (CREATE, READ, UPDATE & DELETE) on a Teachers table in the Database.
This repository is made for beginners who want to learn 3 things:
- ASP.NET Core
- ADO.NET
- CRUD Operations
Download this repository and open it in Visual Studio. Then create the database and teachers table in it. Finally change the connection string given inside the appsetting.json file and you are set to go:
{
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=School;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}
Run the following script to create the Teacher table in your database.
CREATE TABLE [dbo].[Teacher]
(
[Id] INT NOT NULL IDENTITY(1,1) PRIMARY KEY,
[Name] VARCHAR(50) NOT NULL,
[Skills] VARCHAR(250) NOT NULL,
[TotalStudents] INT NOT NULL,
[Salary] MONEY NOT NULL,
[AddedOn] DATE NOT NULL DEFAULT GETDATE()
)
I have explained each and every area of the code in my HACKERNOON article - ASP.NET CORE — Learn CRUD Operations in ADO.NET from Zero to Hero
Your support of every $5 will be a great reward for me to carry on my work. Thank you!