top of page
C # ADO.NET Operations + T-SQL + LINQ + Entity Framework + OOP + N-Tier Architecture

How are Insert, Update, Delete commands implemented with ADO.NET?

Use of ExecuteNonQuery command.

ADO.NET transactions using SqlParameter

Creating a class

1.Class Creation

It is possible to use the connected features on all pages as Public on the classes we create on C #.

In this sense, we make the database connection through the class we have created, as in the example below.

1.jpg

2. Registration to the Database with Ado.Net

3. Updating to the Database with Ado.Net

4. Delete in the Database with Ado.Net

5. Reading data from the database with Ado.Net

Entity Framework and LINQ with C #

  1. First of all, we right-click on our project in the Solution Explorer Window and click Add-NewItem.

  2. We select ADO.NET Entity Data Model from the window that opens and click the Add button.

  3. Then we select the EF Designer from database option from the window that opens.

  4. From here, by saying New Connection, we select the database that we will use in SQL Server and continue.

  5. We tick the Tables option in the window that appears.

  6. After these processes, we will see that our Entity Data Model created comes to the Solution Explorer window.

  7. First of all, we create our object as follows.

Save with Entity Framework

Updating with Entity Framework

Deleting with Entity Framework

Query and Total with LINQ

Query and Datagridview transfer with LINQ

bottom of page