
This data provider can be used to consume data from a SqlConnection. As the connection object will be cloned multiple times, the connection string needs to set Persist Security Info to true if user/password authentication is used. This class is serializable.
'Declaration
Public Class SqlConnectionDataProvider Inherits DbConnectionDataProvider Implements ICanHandleUsedIdentifiers, IDataProvider, combit.Reporting.ISupportsLogger
public class SqlConnectionDataProvider : DbConnectionDataProvider, ICanHandleUsedIdentifiers, IDataProvider, combit.Reporting.ISupportsLogger
public ref class SqlConnectionDataProvider : public DbConnectionDataProvider, ICanHandleUsedIdentifiers, IDataProvider, combit.Reporting.ISupportsLogger
For .NET Framework 4.x, the SqlConnection object comes from the System.Data.SqlClient namespace.
For .NET 6/.NET 8/.NET 9 the Microsoft.Data.SqlClient namespace is used for the SqlConnection object. It may be necessary to set in the used connection string the parameter Encrypt to false if the SQL Server does not use a valid SSL certificate - e.g. for testing purposes.
SqlConnection conn = new SqlConnection(Properties.Settings.Default.ConnectionString); SqlConnectionDataProvider provider = new SqlConnectionDataProvider(conn); LL.DataSource = provider; LL.Design();
Dim conn As New SqlConnection(Properties.Settings.[Default].ConnectionString) Dim provider As New SqlConnectionDataProvider(conn) LL.DataSource = provider LL.Design()
System.Object
combit.Reporting.DataProviders.DbConnectionDataProvider
combit.Reporting.DataProviders.SqlConnectionDataProvider
combit.Reporting.DataProviders.AzureSqlDataProvider
Platforms: Windows 10 (Version 21H2 - 23H2), Windows 11 (21H2 - 22H2), Windows Server 2016 - 2022
.NET: .NET Framework 4.8, .NET 6, .NET 8, .NET 9