Ejemplo n.º 1
0
        /// <summary>
        /// 生成oracle参数
        /// </summary>
        /// <param name="ParamName">字段名</param>
        /// <param name="otype">数据类型</param>
        /// <param name="size">数据大小</param>
        /// <param name="Value">值</param>
        /// <returns></returns>
        public static OracleParameter MakeParam(string ParamName, System.Data.OracleClient.OracleType otype, int size, Object Value)
        {
            OracleParameter para = new OracleParameter(ParamName, Value);

            para.OracleType = otype;
            para.Size       = size;
            return(para);
        }
Ejemplo n.º 2
0
    public System.Data.OracleClient.OracleType GetOracleDBType(string strSystemType)
    {
        System.Data.OracleClient.OracleType dbType = System.Data.OracleClient.OracleType.VarChar;

        switch (strSystemType)
        {
        case "String":
            dbType = System.Data.OracleClient.OracleType.VarChar;
            break;

        case "Int64":
            dbType = System.Data.OracleClient.OracleType.Int32;
            break;

        case "Int32":
            dbType = System.Data.OracleClient.OracleType.Int32;
            break;

        case "DateTime":
            dbType = System.Data.OracleClient.OracleType.DateTime;
            break;

        case "Double":
            dbType = System.Data.OracleClient.OracleType.Double;
            break;

        case "Boolean":
            dbType = System.Data.OracleClient.OracleType.Blob;
            break;

        case "Int16":
            dbType = System.Data.OracleClient.OracleType.Int16;
            break;

        case "Decimal":
            dbType = System.Data.OracleClient.OracleType.Double;
            break;

        case "Cursor":
            dbType = System.Data.OracleClient.OracleType.Cursor;
            break;
        }

        return(dbType);
    }
Ejemplo n.º 3
0
        public static void GetoType(string key, DataTable dt, out System.Data.OracleClient.OracleType otype, out int size)
        {
            DataView dv = dt.DefaultView;

            dv.RowFilter = "column_name='" + key + "'";
            string fType = dv[0]["data_type"].ToString().ToUpper();

            switch (fType)
            {
            case "DATE":
                otype = OracleType.DateTime;
                size  = int.Parse(dv[0]["data_length"].ToString());
                break;

            case "CHAR":
                otype = OracleType.Char;
                size  = int.Parse(dv[0]["data_length"].ToString());
                break;

            case "LONG":
                otype = OracleType.Double;
                size  = int.Parse(dv[0]["data_length"].ToString());
                break;

            case "NVARCHAR2":
                otype = OracleType.NVarChar;
                size  = int.Parse(dv[0]["data_length"].ToString());
                break;

            case "VARCHAR2":
                otype = OracleType.NVarChar;
                size  = int.Parse(dv[0]["data_length"].ToString());
                break;

            default:
                otype = OracleType.NVarChar;
                size  = 100;
                break;
            }
        }
Ejemplo n.º 4
0
 public OracleDBMapping(string first, string second, System.Data.OracleClient.OracleType dbType, int size)
     : base(first, second, DbType.String, size)
 {
     this._type = System.Data.OracleClient.OracleType.VarChar;
     this._type = dbType;
 }
Ejemplo n.º 5
0
 public OracleDBMapping(string first, string second)
     : base(first, second)
 {
     this._type = System.Data.OracleClient.OracleType.VarChar;
 }
Ejemplo n.º 6
0
        OracleDataAccessClient.OracleDbType ConvertOracleType(System.Data.OracleClient.OracleType type)
        {
            switch (type)
            {
            case System.Data.OracleClient.OracleType.Int16:
            case System.Data.OracleClient.OracleType.UInt16:
                return(global::Oracle.DataAccess.Client.OracleDbType.Int16);

            case System.Data.OracleClient.OracleType.Int32:
            case System.Data.OracleClient.OracleType.UInt32:
                return(global::Oracle.DataAccess.Client.OracleDbType.Int32);

            case System.Data.OracleClient.OracleType.Double:
                return(global::Oracle.DataAccess.Client.OracleDbType.Double);

            case System.Data.OracleClient.OracleType.Float:
                return(global::Oracle.DataAccess.Client.OracleDbType.Double);

            case System.Data.OracleClient.OracleType.Byte:
                return(global::Oracle.DataAccess.Client.OracleDbType.Byte);

            case System.Data.OracleClient.OracleType.Char:
                return(global::Oracle.DataAccess.Client.OracleDbType.Char);

            case System.Data.OracleClient.OracleType.Blob:
                return(global::Oracle.DataAccess.Client.OracleDbType.Blob);

            case System.Data.OracleClient.OracleType.BFile:
                return(global::Oracle.DataAccess.Client.OracleDbType.BFile);

            case System.Data.OracleClient.OracleType.Clob:
                return(global::Oracle.DataAccess.Client.OracleDbType.Clob);

            case System.Data.OracleClient.OracleType.Cursor:
                return(global::Oracle.DataAccess.Client.OracleDbType.RefCursor);

            case System.Data.OracleClient.OracleType.DateTime:
                return(global::Oracle.DataAccess.Client.OracleDbType.Date);

            case System.Data.OracleClient.OracleType.LongRaw:
                return(global::Oracle.DataAccess.Client.OracleDbType.LongRaw);

            case System.Data.OracleClient.OracleType.LongVarChar:
                return(global::Oracle.DataAccess.Client.OracleDbType.Long);

            case System.Data.OracleClient.OracleType.NChar:
                return(global::Oracle.DataAccess.Client.OracleDbType.NChar);

            case System.Data.OracleClient.OracleType.NClob:
                return(global::Oracle.DataAccess.Client.OracleDbType.NClob);

            case System.Data.OracleClient.OracleType.Number:
                return(global::Oracle.DataAccess.Client.OracleDbType.Decimal);

            case System.Data.OracleClient.OracleType.NVarChar:
                return(global::Oracle.DataAccess.Client.OracleDbType.NVarchar2);

            case System.Data.OracleClient.OracleType.Raw:
                return(global::Oracle.DataAccess.Client.OracleDbType.Raw);

            case System.Data.OracleClient.OracleType.RowId:
                return(global::Oracle.DataAccess.Client.OracleDbType.NVarchar2);

            case System.Data.OracleClient.OracleType.Timestamp:
                return(global::Oracle.DataAccess.Client.OracleDbType.TimeStamp);

            case System.Data.OracleClient.OracleType.VarChar:
                return(global::Oracle.DataAccess.Client.OracleDbType.Varchar2);

            default:
                throw new NotSupportedException();
            }
        }