コード例 #1
0
        public override IDbDataParameter CreateParameter(string name, Object dbtype, int gxlength, int gxdec)
        {
            IDbDataParameter parm = (IDbDataParameter)ClassLoader.CreateInstance(NpgsqlAssembly, "Npgsql.NpgsqlParameter");

            ClassLoader.SetPropValue(parm, "NpgsqlDbType", GXTypeToNpgsqlDbType(dbtype));
            ClassLoader.SetPropValue(parm, "Size", gxlength);
            ClassLoader.SetPropValue(parm, "Precision", (byte)gxlength);
            ClassLoader.SetPropValue(parm, "Scale", (byte)gxdec);
            ClassLoader.SetPropValue(parm, "ParameterName", name);
            return(parm);
        }
コード例 #2
0
        public override IDbDataParameter CreateParameter(string name, Object dbtype, int gxlength, int gxdec)
        {
            object ifxType = GXTypeToIfxType((GXType)dbtype);

            object[]         args = new object[] { name, ifxType, gxlength };
            IDbDataParameter parm = (IDbDataParameter)ClassLoader.CreateInstance(IfxAssembly, "IBM.Data.Informix.IfxParameter", args);

            ClassLoader.SetPropValue(parm, "IfxType", ifxType);
            parm.Precision = (byte)gxdec;
            parm.Scale     = (byte)gxdec;
            return(parm);
        }
コード例 #3
0
 public ServiceConnectionWrapper(Type runtimeClassType, String connectionString, GxConnectionCache connCache, IsolationLevel isolationLevel, String dataSource)
 {
     try
     {
         _connection = (IDbConnection)Activator.CreateInstance(runtimeClassType);
         if (_connection is IServiceConnection)
         {
             (_connection as IServiceConnection).DataSource = dataSource;
         }
         ClassLoader.SetPropValue(_connection, "ConnectionString", connectionString);
         m_isolationLevel  = isolationLevel;
         m_connectionCache = connCache;
     }
     catch (Exception ex)
     {
         GXLogging.Error(log, "Service data provider Ctr error " + ex.Message + ex.StackTrace);
         throw ex;
     }
 }