To retrieve from and store data to a SQL database, you must define a SQL image data provider.
The ImageGear built-in SQLImageDataProvider is an ADO.NET based ImageProvider, which by default uses Microsoft SQL Server Data provider. However, this provider can be configured to use any database.
The built-in SQLImageDataProvider requires that image data be stored in the database in one of these forms:
- A column/data field containing image data stored as blobs. The image column data type must be binary.

In Microsoft SQL Server, the image column data type is "Image" or "varbinary(MAX)". We recommend the use of latter, since the former has been deprecated in SQL Server 2008. - A column/data field containing a file path and name of an image file.
The built-in SQLImageDataProvider requires that annotation data be stored in the database as follows:
- A column/data field containing annotation data stored as a "CLOB" (Character Large Object).
The built-in SqlImageDataProvider uses the database schema defined in the following files, which are provided in the install folder.
![]() |
The install folder default path may be: C:\ProgramFiles\Accusoft\ImageGear.NET v21\Samples\ASP.NET\SQL or C:\Program Files (x86)\Accusoft\ImageGear.NET v21\Samples\ASP.NET\SQL |
- scriptSQLExpress2005ImageStorageTableSchema.sql
- scriptSQLExpress2008ImageStorageTableSchema.sql
- ImageStorageDBSchemaAndData.sql - Creates database with image data. This is suitable for the sample application.
A custom Sql Image data provider can be written to replace the built-in SqlImageDataProvider. Most databases are transactions-aware but if you choose to use non-transactional database, then you must be mindful of transactions in your custom provider when writing annotations data. The "RadiologyOfficeSample" sample application demonstrates how to write a custom Sql image data provider.