ImageGear .NET - Updated
Image Data Provider Configuration
User Guide > How to Work with... > Common Operations > Viewing > Viewing Using ASP.NET > Web.config Settings for HTML5 Viewer and Legacy ASP.NET Controls > Description of Configuration Settings > Image Data Provider Configuration

The Image Data Provider is an extensible and decoupled module used by ImageGear .NET Web Component. The architecture is based on the ASP.NET Provider model. See Image Data Providers.

There are two methods by which these settings can be configured:

The following example illustrates the settings that must be specified for all image data providers (built-in and custom). 

Web.config
Copy Code
<configuration>
 <configSections>
.....
.....
<section name="ImageGear.Web.DataProviders.ImageProvider" type="ImageGear.Web.DataProviders.ImageDataProviderConfiguration,ImageGear24.Web.Services" />
....
....
</configSections>
.....
......
< ImageGear.Web.DataProviders.ImageProvider default = "SqlImageDataProvider"
  parseToken = "!">
<providers>
<add name="SqlImageDataProvider" type="ImageGear.Web.DataProviders.SqlImageDataProvider,ImageGear24.Web.Services" connectionStringName="SqlImageProviderConnection" sqlCommand="SELECT ImageData FROM dbo.ImageStore WHERE [Image_key] = @Image_key" sqlCommandType="Text" sqlImageDataField="ImageData" sqlParameter="@Image_key" paramKeySqlDbType="UniqueIdentifier" paramKeyLength="36"
cachingEnable="false" sqlCacheDependencyNeeded="false" initSqlCacheDependency="false" maxImageSizeToCache="512" cachingTimeLimit="5" />
sqlInsertCommand="INSERT INTO dbo.ImageStore (Image_key, ImageData) VALUES (@Image_key, @ImageData)"
sqlImageDataParameter="@ImageData”
sqlInsertCommandType="Text"
sqlArtReadCommandType="Text"
sqlArtUpdateCommand="UPDATE dbo.ImageStore SET ArtDocument = @myArtData WHERE [Image_key] = @Image_key"
sqlArtUpdateCommandType="Text"
sqlArtDataField="ArtDocument" sqlImageDataFieldBlob="false" />
<add name="FileImageDataProvider" type="ImageGear.Web.DataProviders.FileImageDataProvider,ImageGear24.Web.Services" storageRootPath="~/viewerImages/" maxImageSizeToCache="512" cachingTimeLimit="5" cachingEnable="false" />
</providers>
</ImageGear.Web.DataProviders.ImageProvider>
....
</configuration>

The section details in the following node must remain the same, even if you write your own custom provider:

Web.config
Copy Code
<section name="ImageGear.Web.DataProviders.ImageProvider" type="ImageGear.Web.DataProviders.ImageDataProviderConfiguration,ImageGear24.Web.Services" />

The section details in the following node define the provider that is used:

Web.config
Copy Code
<ImageGear.Web.DataProviders.ImageProvider default =  "SqlImageDataProvider" >

If the default value is left out, then the first in the list under provider is used as a default. If you are using your custom provider, then replace the default SqlImageDataProvider with your custom provider name.

Each of the providers has its details in the <providers> subsection of <ImageGear.Web.DataProviders.ImageProvider > details section. The custom provider has to be listed in this list with the accompanying assembly name.

This section provides information about the following: