Table of Contents

Class OdbcConnectionDataProvider

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

Provides a data provider implementation for databases accessible via ODBC connections.

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

Examples

The following example demonstrates how to use the OdbcConnectionDataProvider:

// Create an ODBC connection using your connection string.
OdbcConnection connection = new OdbcConnection("your connection string");

// Create an instance of the OdbcConnectionDataProvider with specified identifier delimiter and parameter marker format.
OdbcConnectionDataProvider provider = new OdbcConnectionDataProvider(connection, "[{0}]", "@{0}");

// 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

The OdbcConnectionDataProvider retrieves schema information (tables, views, etc.) and data from a database using an ODBC connection. It supports configuring identifier delimiters and parameter marker formats, and allows advanced features such as custom filter translation. This provider is serializable and can be used as a data source for reporting engines like List & Label.

Constructors

OdbcConnectionDataProvider(OdbcConnection)

Initializes a new instance of the OdbcConnectionDataProvider class with the specified ODBC connection.

public OdbcConnectionDataProvider(OdbcConnection connection)

Parameters

connection OdbcConnection

The ODBC connection.

OdbcConnectionDataProvider(OdbcConnection, string, string)

Initializes a new instance of the OdbcConnectionDataProvider class with the specified ODBC connection, identifier delimiter format, and optional parameter marker format.

public OdbcConnectionDataProvider(OdbcConnection connection, string identifierDelimiterFormat, string parameterMarkerFormat = null)

Parameters

connection OdbcConnection

The ODBC connection.

identifierDelimiterFormat string

The format for delimiting identifiers in SQL queries.

parameterMarkerFormat string

The format for SQL parameter markers (optional).

Properties

IdentifierDelimiterFormat

Gets or sets the format used for delimiting identifiers in SQL queries.

public string IdentifierDelimiterFormat { get; set; }

Property Value

string

ParameterMarkerFormat

Gets or sets the format used for parameter markers in SQL queries.

public string ParameterMarkerFormat { get; set; }

Property Value

string

PrefixTableNameWithSchema

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

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

Methods

Init()

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

protected override void Init()

Events

AddRelations

An event that clients can use to add relations to the data provider.

public event EventHandler<OdbcConnectionDataProvider.AddRelationEventArgs> AddRelations

Event Type

EventHandler<OdbcConnectionDataProvider.AddRelationEventArgs>