Class OleDbConnectionDataProvider
- Namespace
- combit.Reporting.DataProviders
- Assembly
- combit.ListLabel31.CrossPlatform.OleDbConnectionDataProvider.dll
Provides a data provider for OLE DB database connections.
[Serializable]
public class OleDbConnectionDataProvider : DbConnectionDataProvider, IDataProvider, ICanHandleUsedIdentifiers, IDisposable, ISupportsLogger, ISerializable, IFileList
- Inheritance
-
OleDbConnectionDataProvider
- Implements
- Derived
- Inherited Members
Examples
The following example demonstrates how to use the OleDbConnectionDataProvider:
// Create an OLE DB connection using your connection string.
OleDbConnection connection = new OleDbConnection("your connection string");
// Create an instance of the OleDbConnectionDataProvider with a specified identifier delimiter format.
OleDbConnectionDataProvider provider = new OleDbConnectionDataProvider(connection, "[{0}]");
// Assign the provider as the data source.
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 extends DbConnectionDataProvider and supports OLE DB connections, allowing interaction with database elements such as tables and views.
Constructors
OleDbConnectionDataProvider()
Initializes a new instance of the OleDbConnectionDataProvider class.
public OleDbConnectionDataProvider()
OleDbConnectionDataProvider(OleDbConnection)
Initializes a new instance of the OleDbConnectionDataProvider class using the specified OLE DB connection.
public OleDbConnectionDataProvider(OleDbConnection connection)
Parameters
connectionOleDbConnectionThe OLE DB connection.
OleDbConnectionDataProvider(OleDbConnection, string)
Initializes a new instance of the OleDbConnectionDataProvider class using the specified OLE DB connection and identifier delimiter format.
public OleDbConnectionDataProvider(OleDbConnection connection, string identifierDelimiterFormat)
Parameters
connectionOleDbConnectionThe OLE DB connection.
identifierDelimiterFormatstringThe format for delimiting identifiers in queries.
OleDbConnectionDataProvider(SerializationInfo, StreamingContext)
Initializes a new instance of the DbConnectionDataProvider class from serialized data.
protected OleDbConnectionDataProvider(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoThe SerializationInfo that holds the serialized object data.
contextStreamingContextThe contextual information about the source or destination.
Properties
Connection
Gets or sets the OLE DB connection associated with this provider.
public OleDbConnection Connection { get; set; }
Property Value
IdentifierDelimiterFormat
Gets or sets the format used for delimiting identifiers in SQL queries.
public string IdentifierDelimiterFormat { get; set; }
Property Value
SupportedElementTypes
Gets or sets the supported DbConnectionElementTypes for the database connection.
public DbConnectionElementTypes SupportedElementTypes { get; set; }
Property Value
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 sealed bool SupportsAdvancedFiltering { get; set; }
Property Value
Methods
Init()
Initializes the data provider by retrieving database schema information.
protected override void Init()