在 C# 中,有多種資料型別與 Microsoft SQL Server 中所使用的資料型別相對應。下面的表格顯示了各種 SQL Server 資料類型的等效項:
SQL Server Data Type | C# Data Type | |
---|---|---|
Exact Numerics | ||
bigint | Int64 | |
numeric | Decimal | |
bit | Boolean | |
smallint | Int16 | |
decimal | Decimal | |
smallmoney | Decimal | |
int | Int32 | |
tinyint | Byte | |
money | Decimal | |
Approximate Numerics | ||
float | Double | |
real | Single | |
Date and Time | ||
date | None | |
datetimeoffset | None | |
datetime2 | None | |
smalldatetime | DateTime | |
datetime | DateTime | |
time | None | |
Character Strings | ||
char | None | |
varchar | None | |
text | None | |
Unicode Character Strings | ||
nchar | None | |
nvarchar | None | |
ntext | None | |
Binary Strings | ||
binary | Byte[] | |
varbinary | Byte[] | |
image | None | |
Other Data Types | ||
cursor | None | |
timestamp | None | |
hierarchyid | None | |
uniqueidentifier | Guid | |
sql_variant | Object | |
xml | SqlXml | |
table | None |
以上是常見 SQL Server 資料類型的 C# 等效項是什麼?的詳細內容。更多資訊請關注PHP中文網其他相關文章!