コード例 #1
0
ファイル: INFORMIX.cs プロジェクト: Wooyme/HIS-1
 /// <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;
     }
 }
コード例 #2
0
ファイル: INFORMIX.cs プロジェクト: Wooyme/HIS-1
 /// <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);
 }