combit List & Label 29 - .NET Help
combit.Reporting Namespace / ListLabel Class / SetDataBinding Method / SetDataBinding(Object,String) Method

Data source to bind to.

Defines the "main" table and has the effect that only this table and all linked child tables are offered. Tables which are located above the specified table in the hierarchy will be hid. Set this property to empty (String.Empty) if you want to have all tables available generally.

Use the AutoMasterMode Property to choose if the data of the DataMember should be transferred as fields (e.g. for an invoice list) or as variables (e.g. invoice collection).

Example


In This Topic
    SetDataBinding(Object,String) Method
    In This Topic

    Sets the data source and data member to use for the Print Method and Design Method. You can bind to any data for which a provider is available. See the combit.Reporting.DataProviders Namespace for an overview of available data providers. You may also write your own data provider and in this way bind to custom sources not covered yet. The most frequently used objects for data binding are

    Syntax
    'Declaration
     
    
    Public Overloads Overridable Sub SetDataBinding( _
       ByVal dataSource As Object, _
       ByVal dataMember As String _
    ) 
    public virtual void SetDataBinding( 
       object dataSource,
       string dataMember
    )
    public:
    virtual void SetDataBinding( 
       Object^ dataSource,
       String^ dataMember
    ) 

    Parameters

    dataSource

    Data source to bind to.

    dataMember

    Defines the "main" table and has the effect that only this table and all linked child tables are offered. Tables which are located above the specified table in the hierarchy will be hid. Set this property to empty (String.Empty) if you want to have all tables available generally.

    Use the AutoMasterMode Property to choose if the data of the DataMember should be transferred as fields (e.g. for an invoice list) or as variables (e.g. invoice collection).

    Remarks
    Please note that after calling the central data binding capabilities like the Design Method, the Print Method or the Export Method the data source that's assigned to the used List & Label object has to be reassigned/recreated before reusing the object.
    Example
    SqlConnection conn = new SqlConnection(Properties.Settings.Default.ConnectionString);  
    LL.SetDataBinding(conn); 
    LL.Print();
    Requirements

    Platforms: Windows 10 (Version 21H2 - 23H2), Windows 11 (21H2 - 22H2), Windows Server 2016 - 2022
    .NET: .NET Framework 4.8, .NET 6, .NET 7, .NET 8

    See Also