I searched type convertion table between PostgreSQL and C#, but I couldn't find anything. I'll research empty cell on above table if I have time. But if you know the web page which has these information, I'm very appropriate to your help.
Postgre Type --->C# Type bigint --->Int64 bigserial ---> bit [ (n) ] --->Byte[] bit varying [ (n) ] --->Byte boolean --->Boolean box ---> bytea --->Byte[] character varying [ (n) ] ---> String character --->String cidr circle date --->DateTime double precision --->Double inet integer --->Int32 interval [ (p) ] --->TimeSpan line lseg macaddr money numeric [ (p, s) ] --->Decimal decimal [ (p, s) ] --->Decimal path point polygon real --->Single smallint --->Int16 serial text --->String time [ (p) ] [ without time zone ] ---> time [ (p) ] with time zone ---> timestamp [ (p) ] [ without time zone ] ---> timestamp [ (p) ] with time zone ---> tsquery tsvector txid_snapshot uuid --->Guid xml
libpq is the C application programmer's interface to PostgreSQL. libpq is a set of library functions that allow client programs to pass queries to the PostgreSQL backend server and to receive the results of these queries.
Here, dbstring provides required parameters to connect to the datbase, for example dbname = testdb user = postgres password=pass123 hostaddr=127.0. 0.1 port=5432. If connection is setup successfully then it creates C with connection object which provides various useful function public function.
It is a specification that unifies access to relational databases, XML files and other application data. Npgsql is an implementation of the ADO.NET specification for the PostgreSQL database. It is a driver written in C# language and is available for all .
Maybe you can find something looking through the documentation of Npgsql, which is an implementation of a .NET Data Provider for PostgreSQL.
This page of the documentation actually contains a complete table of what you are looking for. Search for "4. Current Npgsql Status" - "Supported data types". There is a nice table with all PostgreSQL data types and their correspondents in .NET.
Postgresql NpgsqlDbType System.DbType Enum .Net System Type ---------- ------------ ------------------ ---------------- int8 Bigint Int64 Int64 bool Boolean Boolean Boolean bytea Bytea Binary Byte[] date Date Date DateTime float8 Double Double Double int4 Integer Int32 Int32 money Money Decimal Decimal numeric Numeric Decimal Decimal float4 Real Single Single int2 Smallint Int16 Int16 text Text String String time Time Time DateTime timetz Time Time DateTime timestamp Timestamp DateTime DateTime timestamptz TimestampTZ DateTime DateTime interval Interval Object TimeSpan varchar Varchar String String inet Inet Object IPAddress bit Bit Boolean Boolean uuid Uuid Guid Guid array Array Object Array
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With