Пример #1
0
        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;
            }
        }
Пример #2
0
        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;
            }
        }