Database: Connectivity

Let's learn about databases.

What are the databases?

Databases store collections of information in an organized way that can easily be added, deleted, and updated.

How to connect a database with C#

In the following example, a local SQL database is created to demonstrate CRUD (Create, Read, Update, Delete) in a database.

Step 1: Create the project

In the first step, we create a .NET Console Application. In the following, we’re using Program.cs as our project.

Step 2: Verify the Entity Frameworks

In the second step, we verify that the Entity Framework is installed. We require the following three Entity Frameworks:

  1. Microsoft.EntityFrameworkCore 2 Microsoft.EntityFrameworkCore.Tools
...