Click or drag to resize

SqlServerPdfStorageProviderConnectionString Property

Gets or sets the connection string used by RAD PDF to connect to SQL Server.

Namespace:  RadPdf.Integration
Assembly:  RadPdf (in RadPdf.dll) Version: (
public string ConnectionString { get; set; }

Property Value

Type: String
ArgumentNullExceptionThe storage connection string can not be null.

A connection string set using this property will override the connection string set in the web.config file (if one exists).

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

using RadPdf.Integration;

public class CustomPdfIntegrationProvider : PdfIntegrationProvider
    public CustomPdfIntegrationProvider() : base()
        // Set storage provider settings, e.g. a new connection string
        ((SqlServerPdfStorageProvider)this.StorageProvider).ConnectionString = "Server=.;Database=RadPdf;Trusted_Connection=Yes;";
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 version="1.0"?>
    <add key="RadPdfLicenseKey" value="DEMO"/>
    <add key="RadPdfIntegrationProvider" value="CustomPdfIntegrationProvider,App_Code"/>
      <add path="RadPdf.axd" verb="GET,POST" type="RadPdf.Web.HttpHandler.PdfHttpHandler"/>
    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.
    <validation validateIntegratedModeConfiguration="false"/>
      <add path="RadPdf.axd" verb="GET,POST" name="PdfHttpHandler" preCondition="integratedMode" type="RadPdf.Web.HttpHandler.PdfHttpHandler"/>
See Also