PostgreSQL C#

This page shows how to manipulate data in a PostgreSQL database from C# applications using ADO.NET.

Create a free Postgres Database in 0.3 seconds on Neon. Ship faster with database branching. Handle peaks efficiently with autoscaling.

Sponsored

Section 1. Getting Started

This section helps you get started by showing you how to install the PostgreSQL driver for ADO.NET, connect to a PostgreSQL database, and create new tables

Section 2. Performing Common Database Operations

This section shows you how to perform common database operations such as inserting, updating, deleting, and retrieving data.

  • Inserting data into a table – Learn how to insert a new row into a table in a PostgreSQL database from a C# program.
  • Import a CSV file into a table – Show you how to load data from a CSV file into a table in a PostgreSQL database using ADO.NET.
  • Updating data – Show you how to update data in a table in a PostgreSQL database from a C# program.
  • Deleting data – Discuss how to delete data from a table in a PostgreSQL database from a C# program.
  • Querying data – Show you how to query one or more rows from a table in a PostgreSQL database from a C# program.

Section 3. Transactions

This section guides you on how to perform a PostgreSQL database transaction in C# program

  • Transaction – Learn to perform a database transaction in PostgreSQL database using C#.

Section 4. Calling PostgreSQL functions and stored procedure

This section shows you how to call PostgreSQL functions and stored procedures from C# programs.

Was this tutorial helpful ?