/// <summary> /// 返回一个DataReader /// </summary> /// <param name="commandText">SQL语句字符串</param> /// <param name="timeOut">超时限制</param> /// <returns></returns> public override IDataReader GetDataReader(string commandText, int timeOut) { IBM.Data.Informix.IfxCommand cmd = new IBM.Data.Informix.IfxCommand(commandText); cmd.Connection = (IBM.Data.Informix.IfxConnection) this.connection; if (timeOut > 30) { cmd.CommandTimeout = timeOut; } if (isInTransaction) { cmd.Transaction = (IBM.Data.Informix.IfxTransaction)transaction; } try { IBM.Data.Informix.IfxDataReader reader = (IBM.Data.Informix.IfxDataReader)cmd.ExecuteReader(); return(reader); } catch (Exception err) { throw new EntityException(err.Message); } finally { cmd.Dispose(); cmd = null; } }
/// <summary> /// 返回一个DataReader /// </summary> /// <param name="cmd">IDbCommand对象</param> /// <returns></returns> public override IDataReader GetDataReader(IDbCommand cmd) { cmd.Connection = this.connection; if (isInTransaction) { cmd.Transaction = (IBM.Data.Informix.IfxTransaction)transaction; } IBM.Data.Informix.IfxDataReader reader = (IBM.Data.Informix.IfxDataReader)cmd.ExecuteReader(); return(reader); }