gpt4 book ai didi

c# - PostgreSQL 和 C# 数据类型

转载 作者:IT王子 更新时间:2023-10-29 03:53:10 29 4
gpt4 key购买 nike

我搜索了 PostgreSQL 和 C# 之间的类型转换表,但我找不到任何东西。如果我有时间,我会研究上表中的空单元格。但是,如果您知道包含这些信息的网页,我将非常适合您的帮助。

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

最佳答案

也许你可以通过文档找到一些东西 Npgsql ,它是 PostgreSQL 的 .NET 数据提供程序的实现。

This page of the documentation实际上包含您要查找的内容的完整表格。搜索“4. 当前 Npgsql 状态”-“支持的数据类型”。有一个很好的表,其中包含所有 PostgreSQL 数据类型及其在 .NET 中的对应项。

Postgresql  NpgsqlDbType System.DbType Enum .NET System Type----------  ------------ ------------------ ----------------int8        Bigint       Int64              Int64bool        Boolean      Boolean            Booleanbytea       Bytea        Binary             Byte[]date        Date         Date               DateTimefloat8      Double       Double             Doubleint4        Integer      Int32              Int32money       Money        Decimal            Decimalnumeric     Numeric      Decimal            Decimalfloat4      Real         Single             Singleint2        Smallint     Int16              Int16text        Text         String             Stringtime        Time         Time               DateTimetimetz      Time         Time               DateTimetimestamp   Timestamp    DateTime           DateTimetimestamptz TimestampTZ  DateTime           DateTimeinterval    Interval     Object             TimeSpanvarchar     Varchar      String             Stringinet        Inet         Object             IPAddressbit         Bit          Boolean            Booleanuuid        Uuid         Guid               Guidarray       Array        Object             Array

关于c# - PostgreSQL 和 C# 数据类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/845458/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com