private void RecreateCommand() { this.FCommand = this.FConnection.CreateCommand(); this.FCommand.CommandTimeout = this.FCommandTimeout; if (this.FTransaction != null) { this.FCommand.Transaction = this.FTransaction; } this.FCommand.CommandText = this.FSql; if (this.FParamTypes != null) { for (int index = 0; index < this.FParamTypes.Length; ++index) { SqlParameter parameter = this.FCommand.CreateParameter(); parameter.ParameterName = string.Format("@{0}", (object)(index + 1)); parameter.DbType = InDbUtils.DataTypeToDbType(this.FParamTypes[index]); int fparamMaxSiz = this.FParamMaxSizes[index]; if (fparamMaxSiz > 0) { parameter.Size = fparamMaxSiz; } this.FCommand.Parameters.Add(parameter); } } this.FCommand.Prepare(); }
internal InDbOracleCommand( OracleConnection connection, OracleTransaction transaction, string sql, params DataType[] paramTypes) { this.FCommand = connection.CreateCommand(); if (transaction != null) { this.FCommand.Transaction = transaction; } sql = OracleSqlPreprocessor.Translate(sql); this.FCommand.CommandText = sql; this.FParamTypes = paramTypes; if (paramTypes == null) { return; } for (int index = 0; index < paramTypes.Length; ++index) { IDbDataParameter parameter = (IDbDataParameter)this.FCommand.CreateParameter(); parameter.ParameterName = string.Format("{0}", (object)(index + 1)); parameter.DbType = InDbUtils.DataTypeToDbType(paramTypes[index]); this.FCommand.Parameters.Add((object)parameter); } }