Using stored procedures in PostgreSQL for CRUD operations in C# Code | Simple Example

preview_player
Показать описание
This video demonstrates how a stored procedure is called from C# code to create, read, update and delete operations in PostgreSQL.

For select operation in C#, please refer to following video:

For connecting to PostgreSQL from C#, please refer to follow video:

Technologies used:
Visual Studio 2019,
C# programming language
Npgsql NuGet Package,
PostgreSQL database management system
Рекомендации по теме
Комментарии
Автор

Why do you say CRUD although read not found?

engalibadouin
Автор

Hi!
Why their is no Read operation? It is the one I am struggling with. I learned myself how to Create, Delete and Update but I have no idea how to get with Postgres. I can’t be considered as CRUD without Read operation. Title is misleading unfortunately.

torrvic
Автор

int aff = cmd.ExecuteNonQuery();
saved = aff == 1;

I always received aff = -1. Can you check your code?

truongkhoan
Автор

Why you are taking command type as text, instead of procedure?, SQL injection may help hackers in this case..

sravana