public object ExecuteReader(string sql, ArrayList parameters) { if (parameters != null) { // Replacement of ? in the parametrized querys for (int i = 0; i < parameters.Count;) { sql = ONSql.Replace(sql, i); i++; } } CreateCommand(sql, parameters); try { object lRet = mSqlCommand.ExecuteReader(); Close(); return(lRet); } catch { Close(); throw; } }
public void ExecuteNonQuery(string sql, ArrayList parameters) { if (parameters != null) { // Replacement of ? in the parametrized querys for (int i = 0; i < parameters.Count;) { sql = ONSql.Replace(sql, i); i++; } } CreateCommand(sql, parameters); try { mSqlCommand.ExecuteNonQuery(); Close(); } catch { Close(); throw; } }