/// <devdoc>
        /// Gets the DbProviderFactory and performs a security check.
        /// </devdoc>
        private DbProviderFactory GetDbProviderFactorySecure()
        {
            if (_providerFactory == null)
            {
                _providerFactory = GetDbProviderFactory();

                Debug.Assert(_providerFactory != null);

                if (!HttpRuntime.DisableProcessRequestInApplicationTrust)
                {
                    // Perform security check if we're not running in application trust
                    if (!HttpRuntime.ProcessRequestInApplicationTrust && !HttpRuntime.HasDbPermission(_providerFactory))
                    {
                        throw new HttpException(SR.GetString(SR.SqlDataSource_NoDbPermission, _providerFactory.GetType().Name, ID));
                    }
                }
            }
            return(_providerFactory);
        }
 private DbProviderFactory GetDbProviderFactorySecure()
 {
     if (this._providerFactory == null)
     {
         this._providerFactory = this.GetDbProviderFactory();
         if ((!HttpRuntime.DisableProcessRequestInApplicationTrust && !HttpRuntime.ProcessRequestInApplicationTrust) && !HttpRuntime.HasDbPermission(this._providerFactory))
         {
             throw new HttpException(System.Web.SR.GetString("SqlDataSource_NoDbPermission", new object[] { this._providerFactory.GetType().Name, this.ID }));
         }
     }
     return(this._providerFactory);
 }