BloggerAD(Head)

2015年8月19日 星期三

DB數字型態 對應 .NET C#

             [MS 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位元組


             [asp.net C#]
------------------------------------
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

沒有留言:

張貼留言