• System.Data.DbType和数据库映射关系


    有如下类型的映射对照:

    System.Data.SqlClient.SqlDbType 

    System.Data.OleDb.OleDbType

    System.Data.Odbc.OdbcType

    System.Data.OracleClient.OracleType

    格式:

    DbType.枚举名(枚举值) = DbType.枚举名(枚举值)

      1 =========== System.Data.SqlClient.SqlDbType =========
      2 
      3  
      4 
      5 System.Data.SqlClient.SqlDbType.BigInt(0)   =  System.Data.DbType.Int64(12)
      6 System.Data.SqlClient.SqlDbType.Binary(1)   =  System.Data.DbType.Binary(1)
      7 System.Data.SqlClient.SqlDbType.Bit(2)   =  System.Data.DbType.Boolean(3)
      8 System.Data.SqlClient.SqlDbType.Char(3)   =  System.Data.DbType.AnsiStringFixedLength(22)
      9 System.Data.SqlClient.SqlDbType.DateTime(4)   =  System.Data.DbType.DateTime(6)
     10 System.Data.SqlClient.SqlDbType.Decimal(5)   =  System.Data.DbType.Decimal(7)
     11 System.Data.SqlClient.SqlDbType.Float(6)   =  System.Data.DbType.Double(8)
     12 System.Data.SqlClient.SqlDbType.Image(7)   =  System.Data.DbType.Binary(1)
     13 System.Data.SqlClient.SqlDbType.Int(8)   =  System.Data.DbType.Int32(11)
     14 System.Data.SqlClient.SqlDbType.Money(9)   =  System.Data.DbType.Currency(4)
     15 System.Data.SqlClient.SqlDbType.NChar(10)   =  System.Data.DbType.StringFixedLength(23)
     16 System.Data.SqlClient.SqlDbType.NText(11)   =  System.Data.DbType.String(16)
     17 System.Data.SqlClient.SqlDbType.NVarChar(12)   =  System.Data.DbType.String(16)
     18 System.Data.SqlClient.SqlDbType.Real(13)   =  System.Data.DbType.Single(15)
     19 System.Data.SqlClient.SqlDbType.UniqueIdentifier(14)   =  System.Data.DbType.Guid(9)
     20 System.Data.SqlClient.SqlDbType.SmallDateTime(15)   =  System.Data.DbType.DateTime(6)
     21 System.Data.SqlClient.SqlDbType.SmallInt(16)   =  System.Data.DbType.Int16(10)
     22 System.Data.SqlClient.SqlDbType.SmallMoney(17)   =  System.Data.DbType.Currency(4)
     23 System.Data.SqlClient.SqlDbType.Text(18)   =  System.Data.DbType.AnsiString(0)
     24 System.Data.SqlClient.SqlDbType.Timestamp(19)   =  System.Data.DbType.Binary(1)
     25 System.Data.SqlClient.SqlDbType.TinyInt(20)   =  System.Data.DbType.Byte(2)
     26 System.Data.SqlClient.SqlDbType.VarBinary(21)   =  System.Data.DbType.Binary(1)
     27 System.Data.SqlClient.SqlDbType.VarChar(22)   =  System.Data.DbType.AnsiString(0)
     28 System.Data.SqlClient.SqlDbType.Variant(23)   =  System.Data.DbType.Object(13)
     29 System.Data.SqlClient.SqlDbType.Xml(25)   =  System.Data.DbType.Xml(25)
     30 System.Data.SqlClient.SqlDbType.Udt(29)   =  System.Data.DbType.Object(13)
     31 System.Data.SqlClient.SqlDbType.Structured(30)   =  System.Data.DbType.Object(13)
     32 System.Data.SqlClient.SqlDbType.Date(31)   =  System.Data.DbType.Date(5)
     33 System.Data.SqlClient.SqlDbType.Time(32)   =  System.Data.DbType.Time(17)
     34 System.Data.SqlClient.SqlDbType.DateTime2(33)   =  System.Data.DbType.DateTime2(26)
     35 System.Data.SqlClient.SqlDbType.DateTimeOffset(34)   =  System.Data.DbType.DateTimeOffset(27)
     36 
     37  
     38 
     39 ===========System.Data.OleDb.OleDbType=========
     40 
     41 
     42 System.Data.OleDb.OleDbType.Empty(0)   =  System.Data.DbType.Object(13)
     43 System.Data.OleDb.OleDbType.SmallInt(2)   =  System.Data.DbType.Int16(10)
     44 System.Data.OleDb.OleDbType.Integer(3)   =  System.Data.DbType.Int32(11)
     45 System.Data.OleDb.OleDbType.Single(4)   =  System.Data.DbType.Single(15)
     46 System.Data.OleDb.OleDbType.Double(5)   =  System.Data.DbType.Double(8)
     47 System.Data.OleDb.OleDbType.Currency(6)   =  System.Data.DbType.Currency(4)
     48 System.Data.OleDb.OleDbType.Date(7)   =  System.Data.DbType.DateTime(6)
     49 System.Data.OleDb.OleDbType.BSTR(8)   =  System.Data.DbType.String(16)
     50 System.Data.OleDb.OleDbType.IDispatch(9)   =  System.Data.DbType.Object(13)
     51 System.Data.OleDb.OleDbType.Error(10)   =  System.Data.DbType.Int32(11)
     52 System.Data.OleDb.OleDbType.Boolean(11)   =  System.Data.DbType.Boolean(3)
     53 System.Data.OleDb.OleDbType.Variant(12)   =  System.Data.DbType.Object(13)
     54 System.Data.OleDb.OleDbType.IUnknown(13)   =  System.Data.DbType.Object(13)
     55 System.Data.OleDb.OleDbType.Decimal(14)   =  System.Data.DbType.Decimal(7)
     56 System.Data.OleDb.OleDbType.TinyInt(16)   =  System.Data.DbType.SByte(14)
     57 System.Data.OleDb.OleDbType.UnsignedTinyInt(17)   =  System.Data.DbType.Byte(2)
     58 System.Data.OleDb.OleDbType.UnsignedSmallInt(18)   =  System.Data.DbType.UInt16(18)
     59 System.Data.OleDb.OleDbType.UnsignedInt(19)   =  System.Data.DbType.UInt32(19)
     60 System.Data.OleDb.OleDbType.BigInt(20)   =  System.Data.DbType.Int64(12)
     61 System.Data.OleDb.OleDbType.UnsignedBigInt(21)   =  System.Data.DbType.UInt64(20)
     62 System.Data.OleDb.OleDbType.Filetime(64)   =  System.Data.DbType.DateTime(6)
     63 System.Data.OleDb.OleDbType.Guid(72)   =  System.Data.DbType.Guid(9)
     64 System.Data.OleDb.OleDbType.Binary(128)   =  System.Data.DbType.Binary(1)
     65 System.Data.OleDb.OleDbType.Char(129)   =  System.Data.DbType.AnsiStringFixedLength(22)
     66 System.Data.OleDb.OleDbType.WChar(130)   =  System.Data.DbType.StringFixedLength(23)
     67 System.Data.OleDb.OleDbType.Numeric(131)   =  System.Data.DbType.Decimal(7)
     68 System.Data.OleDb.OleDbType.DBDate(133)   =  System.Data.DbType.Date(5)
     69 System.Data.OleDb.OleDbType.DBTime(134)   =  System.Data.DbType.Time(17)
     70 System.Data.OleDb.OleDbType.DBTimeStamp(135)   =  System.Data.DbType.DateTime(6)
     71 System.Data.OleDb.OleDbType.PropVariant(138)   =  System.Data.DbType.Object(13)
     72 System.Data.OleDb.OleDbType.VarNumeric(139)   =  System.Data.DbType.VarNumeric(21)
     73 System.Data.OleDb.OleDbType.VarChar(200)   =  System.Data.DbType.AnsiString(0)
     74 System.Data.OleDb.OleDbType.LongVarChar(201)   =  System.Data.DbType.AnsiString(0)
     75 System.Data.OleDb.OleDbType.VarWChar(202)   =  System.Data.DbType.String(16)
     76 System.Data.OleDb.OleDbType.LongVarWChar(203)   =  System.Data.DbType.String(16)
     77 System.Data.OleDb.OleDbType.VarBinary(204)   =  System.Data.DbType.Binary(1)
     78 System.Data.OleDb.OleDbType.LongVarBinary(205)   =  System.Data.DbType.Binary(1)
     79 
     80 
     81 =========System.Data.Odbc.OdbcType===========
     82 
     83 
     84 System.Data.Odbc.OdbcType.BigInt(1)   =  System.Data.DbType.Int64(12)
     85 System.Data.Odbc.OdbcType.Binary(2)   =  System.Data.DbType.Binary(1)
     86 System.Data.Odbc.OdbcType.Bit(3)   =  System.Data.DbType.Boolean(3)
     87 System.Data.Odbc.OdbcType.Char(4)   =  System.Data.DbType.AnsiStringFixedLength(22)
     88 System.Data.Odbc.OdbcType.DateTime(5)   =  System.Data.DbType.DateTime(6)
     89 System.Data.Odbc.OdbcType.Decimal(6)   =  System.Data.DbType.Decimal(7)
     90 System.Data.Odbc.OdbcType.Numeric(7)   =  System.Data.DbType.Decimal(7)
     91 System.Data.Odbc.OdbcType.Double(8)   =  System.Data.DbType.Double(8)
     92 System.Data.Odbc.OdbcType.Image(9)   =  System.Data.DbType.Binary(1)
     93 System.Data.Odbc.OdbcType.Int(10)   =  System.Data.DbType.Int32(11)
     94 System.Data.Odbc.OdbcType.NChar(11)   =  System.Data.DbType.StringFixedLength(23)
     95 System.Data.Odbc.OdbcType.NText(12)   =  System.Data.DbType.String(16)
     96 System.Data.Odbc.OdbcType.NVarChar(13)   =  System.Data.DbType.String(16)
     97 System.Data.Odbc.OdbcType.Real(14)   =  System.Data.DbType.Single(15)
     98 System.Data.Odbc.OdbcType.UniqueIdentifier(15)   =  System.Data.DbType.Guid(9)
     99 System.Data.Odbc.OdbcType.SmallDateTime(16)   =  System.Data.DbType.DateTime(6)
    100 System.Data.Odbc.OdbcType.SmallInt(17)   =  System.Data.DbType.Int16(10)
    101 System.Data.Odbc.OdbcType.Text(18)   =  System.Data.DbType.AnsiString(0)
    102 System.Data.Odbc.OdbcType.Timestamp(19)   =  System.Data.DbType.Binary(1)
    103 System.Data.Odbc.OdbcType.TinyInt(20)   =  System.Data.DbType.Byte(2)
    104 System.Data.Odbc.OdbcType.VarBinary(21)   =  System.Data.DbType.Binary(1)
    105 System.Data.Odbc.OdbcType.VarChar(22)   =  System.Data.DbType.AnsiString(0)
    106 System.Data.Odbc.OdbcType.Date(23)   =  System.Data.DbType.Date(5)
    107 System.Data.Odbc.OdbcType.Time(24)   =  System.Data.DbType.Time(17)
    108 
    109 
    110 =========System.Data.OracleClient.OracleType===========
    111 
    112 
    113 System.Data.OracleClient.OracleType.BFile(1)   =  System.Data.DbType.Binary(1)
    114 System.Data.OracleClient.OracleType.Blob(2)   =  System.Data.DbType.Binary(1)
    115 System.Data.OracleClient.OracleType.Char(3)   =  System.Data.DbType.AnsiStringFixedLength(22)
    116 System.Data.OracleClient.OracleType.Clob(4)   =  System.Data.DbType.AnsiString(0)
    117 System.Data.OracleClient.OracleType.Cursor(5)   =  System.Data.DbType.Object(13)
    118 System.Data.OracleClient.OracleType.DateTime(6)   =  System.Data.DbType.DateTime(6)
    119 System.Data.OracleClient.OracleType.IntervalDayToSecond(7)   =  System.Data.DbType.Object(13)
    120 System.Data.OracleClient.OracleType.IntervalYearToMonth(8)   =  System.Data.DbType.Int32(11)
    121 System.Data.OracleClient.OracleType.LongRaw(9)   =  System.Data.DbType.Binary(1)
    122 System.Data.OracleClient.OracleType.LongVarChar(10)   =  System.Data.DbType.AnsiString(0)
    123 System.Data.OracleClient.OracleType.NChar(11)   =  System.Data.DbType.StringFixedLength(23)
    124 System.Data.OracleClient.OracleType.NClob(12)   =  System.Data.DbType.String(16)
    125 System.Data.OracleClient.OracleType.Number(13)   =  System.Data.DbType.VarNumeric(21)
    126 System.Data.OracleClient.OracleType.NVarChar(14)   =  System.Data.DbType.String(16)
    127 System.Data.OracleClient.OracleType.Raw(15)   =  System.Data.DbType.Binary(1)
    128 System.Data.OracleClient.OracleType.RowId(16)   =  System.Data.DbType.AnsiString(0)
    129 System.Data.OracleClient.OracleType.Timestamp(18)   =  System.Data.DbType.DateTime(6)
    130 System.Data.OracleClient.OracleType.TimestampLocal(19)   =  System.Data.DbType.DateTime(6)
    131 System.Data.OracleClient.OracleType.TimestampWithTZ(20)   =  System.Data.DbType.DateTime(6)
    132 System.Data.OracleClient.OracleType.VarChar(22)   =  System.Data.DbType.AnsiString(0)
    133 System.Data.OracleClient.OracleType.Byte(23)   =  System.Data.DbType.Byte(2)
    134 System.Data.OracleClient.OracleType.UInt16(24)   =  System.Data.DbType.UInt16(18)
    135 System.Data.OracleClient.OracleType.UInt32(25)   =  System.Data.DbType.UInt32(19)
    136 System.Data.OracleClient.OracleType.SByte(26)   =  System.Data.DbType.SByte(14)
    137 System.Data.OracleClient.OracleType.Int16(27)   =  System.Data.DbType.Int16(10)
    138 System.Data.OracleClient.OracleType.Int32(28)   =  System.Data.DbType.Int32(11)
    139 System.Data.OracleClient.OracleType.Float(29)   =  System.Data.DbType.Single(15)
    140 System.Data.OracleClient.OracleType.Double(30)   =  System.Data.DbType.Double(8)
  • 相关阅读:
    Python JPype 在 Win7 下安装与使用
    Visual Studio 2010 下 安装RGiesecke.DllExport
    python简单搭建HTTP Web服务器
    C 语言中 malloc、calloc、realloc 和free 函数的使用方法
    Anaconda 安装 ml_metrics package
    第28章 java反射机制
    第26章 java进制操作
    第27章 java I/O输入输出流
    第25章 网络编程
    第23章 java线程通信——生产者/消费者模型案例
  • 原文地址:https://www.cnblogs.com/AnXinliang/p/5950737.html
Copyright © 2020-2023  润新知