Click or drag to resize

SqlServerPdfStorageProviderCommandTimeout Property

Gets or sets the wait time before terminating the attempt to execute an internal SqlCommand and generating an error.

Namespace:  RadPdf.Integration
Assembly:  RadPdf (in RadPdf.dll) Version: 3.48.0.0 (3.48.0.0)
Syntax
public int CommandTimeout { get; set; }

Property Value

Type: Int32
The time in seconds to wait for a single internal SqlCommand to execute. The default is DefaultCommandTimeout.
Exceptions
ExceptionCondition
ArgumentExceptionThe property value assigned is less than 0.
Remarks

A value of 0 indicates no limit (an attempt to execute a command will wait indefinitely).

CommandTimeout has no effect when the command is executed against a context connection (a SqlConnection opened with "context connection=true" in the connection string).

This property controls the timeout per command executed. Internally, RAD PDF may execute several commands during a single procedure. This value simply sets the CommandTimeout used by each internal SqlCommand instance.

Examples
The following example overrides the default PdfIntegrationProvider to create a custom Integration Provider for the web application which specifies the SQL Server connection string.
C#
using System;
using System.Web;

using RadPdf.Integration;

public class CustomPdfIntegrationProvider : PdfIntegrationProvider
{
    public CustomPdfIntegrationProvider() : base()
    {
        // Set a 10 minute timeout instead of the default (30 seconds)
        ((SqlServerPdfStorageProvider)this.StorageProvider).CommandTimeout = 600;
    }
}
The following web.config file registers the above custom Integration Provider. This example assumes that CustomPdfIntegrationProvider is in the directory App_Code of your ASP.NET web application.
XML
<?xml version="1.0"?>
<configuration>
  <appSettings>
    <add key="RadPdfLicenseKey" value="DEMO"/>
    <add key="RadPdfIntegrationProvider" value="CustomPdfIntegrationProvider,App_Code"/>
  </appSettings>
  <system.web>
    <httpHandlers>
      <add path="RadPdf.axd" verb="GET,POST" type="RadPdf.Web.HttpHandler.PdfHttpHandler"/>
    </httpHandlers>
  </system.web>
  <!--
    The system.webServer element is for use with IIS 7 (and later) when Managed Pipeline Mode is set to "Integrated".
    It will be ignored in other versions of IIS.
    -->
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <handlers>
      <add path="RadPdf.axd" verb="GET,POST" name="PdfHttpHandler" preCondition="integratedMode" type="RadPdf.Web.HttpHandler.PdfHttpHandler"/>
    </handlers>
  </system.webServer>
</configuration>
See Also