Oracle数据类型(OracleDbType)名称对应.NET类型(Type)
作者:C/S框架网|www.cscode.ne  发布日期:2021/06/08 11:06:17
  Oracle数据类型(OracleDbType)名称对应.NET类型(Type)

Oracle数据类型(OracleDbType)名称对应.NET类型(Type)



C# Code:


/// <summary>
/// Oracle数据类型名称(如:CLOB,BLOG)对应.NET类型
/// Oracle数据类型(OracleDbType)名称对应.NET类型(Type)
/// </summary>
public static IDictionary<string, Type> OracleDbTypeName2NetTypeMapping
{
  
get
  {
    IDictionary
<string, Type> map = new Dictionary<string, Type>();
    map.Add(
"BFile", typeof(System.Byte[]));
    map.Add(
"Binary_Double", typeof(System.Double));
    map.Add(
"Binary_Float", typeof(System.Single));
    map.Add(
"Blob", typeof(System.Byte[]));
    map.Add(
"Boolean", typeof(System.Boolean));
    map.Add(
"Byte", typeof(System.Byte));
    map.Add(
"Char", typeof(System.Char));
    map.Add(
"Clob", typeof(System.String));
    map.Add(
"Date", typeof(System.DateTime));
    map.Add(
"Decimal", typeof(System.Decimal));
    map.Add(
"Double", typeof(System.Double));
    map.Add(
"Float", typeof(System.Single));
    map.Add(
"Int16", typeof(System.Int16));
    map.Add(
"Int32", typeof(System.Int32));
    map.Add(
"Int64", typeof(System.Int64));
    map.Add(
"Integer", typeof(System.Int32));
    map.Add(
"IntervalDS", typeof(System.Double));//OracleIntervalDS(double totalDays);
    
map.Add("IntervalYM", typeof(System.Int32));
    map.Add(
"Long", typeof(System.String));//Text
    
map.Add("LongRaw", typeof(System.Byte[]));
    map.Add(
"NChar", typeof(System.String));
    map.Add(
"NClob", typeof(System.String));
    map.Add(
"Number", typeof(System.Decimal));
    map.Add(
"Numeric", typeof(System.Decimal));
    map.Add(
"NVarchar2", typeof(System.String));
    map.Add(
"Raw", typeof(System.Byte[]));
    map.Add(
"Real", typeof(System.Decimal));
    map.Add(
"RefCursor", typeof(System.Object));//游标类型
    
map.Add("RowID", typeof(System.String));
    map.Add(
"Single", typeof(System.Single));
    map.Add(
"SmallInt", typeof(System.Int16));
    map.Add(
"TimeStamp", typeof(System.DateTime));
    map.Add(
"TimeStampLTZ", typeof(System.DateTime));
    map.Add(
"TimeStampTZ", typeof(System.DateTime));
    map.Add(
"UROWID", typeof(System.String));
    map.Add(
"Varchar", typeof(System.String));
    map.Add(
"Varchar2", typeof(System.String));
    map.Add(
"XmlType", typeof(System.String));
    
    
return map;
  }
}


//来源:C/S框架网 | www.csframework.com | QQ:23404761




C/S框架网|原创精神.创造价值.打造精品

扫一扫加微信
C/S框架网作者微信 C/S框架网|原创作品.质量保障.竭诚为您服务

上一篇 下一篇