首页 > 代码库 > CodeSmith,SqlServer,C#中的类型对照

CodeSmith,SqlServer,C#中的类型对照

SqlServer         CodeSmith                                   c#
bigint                  Int64                                        Int64
binary                 Binary                               System.Byte[]
bit                      Boolean                                    bool
char                  AnsiStringFixedLength              string
datetime             DateTime                                   string
decimal              Decimal                                    Decimal
float                   Double                                        Double
image                 Binary                                System.Byte[]
int                      Int32                                            int
money               Currency                                   Single
nchar                 StringFixedLength                          string
ntext                  String                                            string
numeric             Decimal                                    Decimal
nvarchar            String                                            string
real                   Single                                            Single
smalldatetime     DateTime                                       string
smallint               Int16                                            Int16
smallmoney         Currency                                   Single
sql_variant          Object                                        Object
text                     AnsiString                                   string
timestamp           Binary                                    System.Byte[]
tinyint                  Byte                                            Byte
uniqueidentifier     Guid                                       System.Guid
varbinary             Binary                                    System.Byte[]
varchar                AnsiString                                   string

其中有些类型为了处理简便,做了一些调整。如:DataTime类型转成string型处理

CodeSmith,SqlServer,C#中的类型对照