示例#1
0
        /// <summary>
        /// Compiles this operation.  Ignores subsequent attempts to compile.
        /// </summary>
        public override void Compile()
        {
            if (!Compiled)
            {
                if (Sql == null)
                {
                    throw new InvalidDataAccessApiUsageException("Setting of Sql is required");
                }
                if (CommandType == 0)
                {
                    throw new InvalidDataAccessApiUsageException("Setting of CommandType is required");
                }

                try
                {
                    adoTemplate.AfterPropertiesSet();
                }
                catch (ArgumentException ex)
                {
                    throw new InvalidDataAccessApiUsageException(ex.Message);
                }


                CompileInternal();
                compiled = true;
            }
        }