Table of Contents

Class SqlConnectionDataProvider

Namespace
combit.Reporting.DataProviders
Assembly
combit.ListLabel31.CrossPlatform.SqlConnectionDataProvider.dll

Provides data access capabilities for SQL Server connections.

[Serializable]
public class SqlConnectionDataProvider : DbConnectionDataProvider, IDataProvider, ICanHandleUsedIdentifiers, IDisposable, ISupportsLogger, ISerializable
Inheritance
SqlConnectionDataProvider
Implements
Derived
Inherited Members

Examples

The following example demonstrates how to use the SqlConnectionDataProvider:

// Create a SQL connection using your connection string.
SqlConnection connection = new SqlConnection("your connection string");

// Create an instance of the OdbcConnectionDataProvider with specified identifier delimiter and parameter marker format.
SqlConnectionDataProvider provider = new SqlConnectionDataProvider(connection);

// Assign the provider as the data source for the List & Label reporting engine.
using ListLabel listLabel = new ListLabel();
listLabel.DataSource = provider;
ExportConfiguration exportConfiguration = new ExportConfiguration(LlExportTarget.Pdf, exportFilePath, projectFilePath);
exportConfiguration.ShowResult = true;
listLabel.Export(exportConfiguration);

Remarks

This class supports table and view elements and allows schema-based filtering.

Constructors

SqlConnectionDataProvider()

Default constructor for SqlConnectionDataProvider.

protected SqlConnectionDataProvider()

SqlConnectionDataProvider(SqlConnection)

Initializes a new instance of the SqlConnectionDataProvider class.

public SqlConnectionDataProvider(SqlConnection connection)

Parameters

connection SqlConnection

The SQL Server connection.

SqlConnectionDataProvider(SqlConnection, ReadOnlyCollection<string>)

Initializes a new instance of the SqlConnectionDataProvider class with multiple table schemas.

public SqlConnectionDataProvider(SqlConnection connection, ReadOnlyCollection<string> tableSchemas)

Parameters

connection SqlConnection

The SQL Server connection.

tableSchemas ReadOnlyCollection<string>

A read-only collection of table schemas.

SqlConnectionDataProvider(SqlConnection, string)

Initializes a new instance of the SqlConnectionDataProvider class with a specific table schema.

public SqlConnectionDataProvider(SqlConnection connection, string tableSchema)

Parameters

connection SqlConnection

The SQL Server connection.

tableSchema string

The table schema to use.

SqlConnectionDataProvider(SerializationInfo, StreamingContext)

Initializes a new instance of the SqlConnectionDataProvider class from serialization data.

protected SqlConnectionDataProvider(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

The serialization information.

context StreamingContext

The streaming context.

Properties

PrefixTableNameWithSchema

Gets or sets a value indicating whether table names should be prefixed with the schema name.

public bool PrefixTableNameWithSchema { get; set; }

Property Value

bool

SupportedElementTypes

Gets or sets the supported DbConnectionElementTypes for the database connection.

public DbConnectionElementTypes SupportedElementTypes { get; set; }

Property Value

DbConnectionElementTypes

Remarks

This property indicates which element types (tables, views) are supported by this data provider.

SupportsAdvancedFiltering

Gets or sets a value indicating whether advanced filtering is supported by the data provider.

public override bool SupportsAdvancedFiltering { get; set; }

Property Value

bool

TableSchemas

Gets a read-only collection of table schemas used by this provider.

protected ReadOnlyCollection<string> TableSchemas { get; set; }

Property Value

ReadOnlyCollection<string>

Methods

GetNativeAggregateFunctionName(NativeAggregateFunction)

Gets the native SQL Server aggregate function name for the given NativeAggregateFunction.

protected override string GetNativeAggregateFunctionName(NativeAggregateFunction functionInstance)

Parameters

functionInstance NativeAggregateFunction

The aggregate function instance.

Returns

string

The corresponding SQL Server aggregate function name.

Init()

When implemented in a derived class, initializes the data provider.

protected override void Init()

InitSqlModifications()

Initializes SQL-specific modifications such as table name validation and identifier formatting.

protected void InitSqlModifications()