Click or drag to resize

DbSqlImageAccessor Constructor (GetConnectionCallback, Boolean, String, String, String, String, String, String, IDictionary)

Creates an object that can be used with DbImageSource to access images stored in a database. The image streams are access by combining clauses of SQL Statements provided.

Namespace:  Atalasoft.Imaging.ImageSources.Data
Assembly:  Atalasoft.dotImage (in Atalasoft.dotImage.dll) Version: 11.0.0.0.0.297 (.NET 4.5.2, x86)
Syntax
public DbSqlImageAccessor(
	GetConnectionCallback getConnection,
	bool encryptSerializedState,
	string imageField,
	string primaryKeyFields,
	string fromClause,
	string whereClause,
	string orderByClause,
	string frameCountField,
	IDictionary extraParameters
)

Parameters

getConnection
Type: Atalasoft.Imaging.ImageSources.DataGetConnectionCallback
A delegate that can return connections to the database. This accessor must be able to be serialized, so make the delegate to a static method. If this accessor is used in an imagesoruce that is used in ASP.NET controls, then it will be serialized. This class creates SQL statements that use CTE from SQL Server, so the connection needs to be to a database that supports them.
encryptSerializedState
Type: SystemBoolean
True if the serialized state of the object will be encrypted. Please see documentation of sub-classes to see which members are encrypted.
imageField
Type: SystemString
The name of the image field in the data source (given by the fromClause). Can be an expression, but then an "as" with a field name must appear at the end of it.
primaryKeyFields
Type: SystemString
A comma separated list of the primary keys of the data source (given by the fromClause).
fromClause
Type: SystemString
The source of the data rows. This would normally be a table name, but it can be anything that can appear in the from clause of a SQL Select statement. It should not contain "from" at the beginning.
whereClause
Type: SystemString
A clause that can be used in a where clause of a SQL Select statement. It can be null, which means that you want all rows to be returned. It should not contain "where" at the beginning.
orderByClause
Type: SystemString
A clause that can be used in an order by clause. If it is null, the data set is ordered by the primary keys. The dataset must have a defined order. It should not contain "order by" at the beginning.
frameCountField
Type: SystemString
The name of the frameCount field in the data source (given by the fromClause>. If it is null, the frame count will be determined by decoding the image stream.
extraParameters
Type: System.CollectionsIDictionary
The parameters that are passed to all of your stored procedures. For SqlCommands, the keys should be strings which are the names of the parameters and start with an @. For OleDbCommands, you must use a IDictionary with sorted keys (e.g. SortedList) and use index numbers (starting at 0) as keys. The parameters are added in the sort order of the keys. The values can be any object that can be automatically converted by the IDbDataParameter for your connection. The
extraParameters
are not encrypted when this object is serialized. A copy of the the dictionary will be made upon construction, so that changes to it will not affect this object.
See Also