Table of Contents

Class MySqlConnectionDataProvider

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

Provides a data provider implementation for MySQL databases using the MySQL Connector/NET.

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

Examples

The following example demonstrates how to use the MySqlConnectionDataProvider to export a report to PDF:

// Create an instance of the MySqlConnectionDataProvider using a connection string.
MySqlConnectionDataProvider provider = new MySqlConnectionDataProvider("your connection string here");

// Create a ListLabel reporting engine instance and assign the provider as the data source.
using ListLabel listLabel = new ListLabel();
listLabel.DataSource = provider;

// Configure export settings to generate a PDF.
ExportConfiguration exportConfiguration = new ExportConfiguration(LlExportTarget.Pdf, @"C:\Exports\report.pdf", @"C:\Projects\report.llproj");
exportConfiguration.ShowResult = true;

// Export the report to PDF.
listLabel.Export(exportConfiguration);

Remarks

The MySqlConnectionDataProvider class extends DbConnectionDataProvider and enables connectivity to MySQL databases. It supports tables and views, advanced filtering, and schema-aware query construction using a customizable identifier delimiter and parameter marker format. This provider is serializable and can be used as a data source for reporting engines such as List & Label.

Constructors

MySqlConnectionDataProvider()

Initializes a new instance of the MySqlConnectionDataProvider class.

protected MySqlConnectionDataProvider()

MySqlConnectionDataProvider(IDbConnection)

Initializes a new instance of the MySqlConnectionDataProvider class using the specified MySQL connection.

public MySqlConnectionDataProvider(IDbConnection connection)

Parameters

connection IDbConnection

An open MySQL connection.

Exceptions

ListLabelException

Thrown if the provided connection is not a valid MySQL connection.

MySqlConnectionDataProvider(SerializationInfo, StreamingContext)

Initializes a new instance of the MySqlConnectionDataProvider class from serialized data.

protected MySqlConnectionDataProvider(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

The SerializationInfo to populate with data.

context StreamingContext

The destination for this serialization.

MySqlConnectionDataProvider(string)

Initializes a new instance of the MySqlConnectionDataProvider class using the specified connection string.

public MySqlConnectionDataProvider(string connectionString)

Parameters

connectionString string

The connection string for connecting to the MySQL database.

Properties

PrefixTableNameWithSchema

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

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

GetNativeAggregateFunctionName(NativeAggregateFunction)

Gets the native aggregate function name for the given aggregate function instance. Override this method to return null if the function is not supported by the data provider.

protected override string GetNativeAggregateFunctionName(NativeAggregateFunction function)

Parameters

function NativeAggregateFunction

Returns

string

The native aggregate function name as a string; by default, the function name is returned in upper case.

Init()

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

protected override void Init()

OnTranslateFilterSyntax(object, TranslateFilterSyntaxEventArgs)

Raises the TranslateFilterSyntax event.

protected override void OnTranslateFilterSyntax(object sender, TranslateFilterSyntaxEventArgs e)

Parameters

sender object

The source of the event.

e TranslateFilterSyntaxEventArgs

A TranslateFilterSyntaxEventArgs that contains the event data.