C# DB數字型態 對應

             [SQL]
------------------------------------
bigint   | -2^63~2^63-1)| 8位元組
------------------------------------
int      |(-2^31~2^31-1)| 4位元組
------------------------------------
smallint |(-2^15~2^15-1)| 2位元組
------------------------------------
tinyint  |(0~255)       | 1位元組


             [.netC#]
------------------------------------
Int64    | -2^63~2^63-1)| 8位元組
------------------------------------
Int32    |(-2^31~2^31-1)| 4位元組
------------------------------------
Integer  |(-2^31~2^31-1)| 4位元組
------------------------------------
Int16    |(-2^15~2^15-1)| 2位元組


↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓對應↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

[MS SQL][C#]
bit     <=>bool
tinyint     <=>byte
smallint  <=>short、Int16
int  <=>int、Int32、Integer
bigint  <=>long、Int32
real  <=>float
float  <=>double
money  <=>decimal
decimal  <=>decimal
datetime  <=>DateTime
char  <=>string
varchar  <=>string
nchar  <=>string
nvarchar  <=>string
text   <=>string
ntext  <=>string
image  <=>byte[]
binary  <=>byte[]
uniqueidentifier  <=>Guid

real                              <=>                float
tinyint                         <=>                byte

留言

這個網誌中的熱門文章

C# 在 GDI+ 中發生泛型錯誤

[LeetCode] Robot Return to Origin