/// <summary> /// Gets the reader. /// </summary> /// <param name="qry">The qry.</param> /// <returns></returns> public override IDataReader GetReader(QueryCommand qry) { AutomaticConnectionScope automaticConnectionScope = new AutomaticConnectionScope(this); OracleCommand cmd = new OracleCommand(qry.CommandSql); cmd.CommandType = qry.CommandType; cmd.CommandTimeout = qry.CommandTimeout; AddParams(cmd, qry); cmd.Connection = (OracleConnection)automaticConnectionScope.Connection; IDataReader rdr; try { rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection); } catch (OracleException) { automaticConnectionScope.Dispose(); throw; } return(rdr); }
/// <summary> /// Gets the reader. /// </summary> /// <param name="qry">The qry.</param> /// <returns></returns> public override IDataReader GetReader(QueryCommand qry) { AutomaticConnectionScope conn = new AutomaticConnectionScope(this); MySqlCommand cmd = new MySqlCommand(qry.CommandSql); cmd.CommandType = qry.CommandType; cmd.CommandTimeout = qry.CommandTimeout; AddParams(cmd, qry); cmd.Connection = (MySqlConnection)conn.Connection; IDataReader rdr; try { rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection); } catch (MySqlException x) { conn.Dispose(); throw x; } CheckoutOutputParams(cmd, qry); return(rdr); }
/// <summary> /// Gets the database version. /// </summary> /// <param name="providerName">Name of the provider.</param> /// <returns></returns> protected override string GetDatabaseVersion(string providerName) { string retVal = "Unknown"; AutomaticConnectionScope conn = new AutomaticConnectionScope(this); try { retVal = conn.GetConnection <MySqlConnection>().ServerVersion; } catch {} finally { if (!conn.IsUsingSharedConnection) { conn.Dispose(); } } return(retVal); }