combit List & Label 30 - .NET Help
combit.Reporting.DataProviders Namespace / DbCommandSetDataProvider Class / AddRelation Method / AddRelation(String,String,String,String,String) Method

Name for the relation. May appear in the UI if multiple relations exist between the same two tables.

Name of the parent table.

Name of the child table.

Column name of the parent table. See remark section for composite key fields.

Column name of the child table. See remark section for composite key fields.



AddRelation(String,String,String,String,String) Method

Adds a relation between two commands/tables.

Syntax

Parameters

relationName

Name for the relation. May appear in the UI if multiple relations exist between the same two tables.

parentTableName

Name of the parent table.

childTableName

Name of the child table.

parentColumnName

Column name of the parent table. See remark section for composite key fields.

childColumnName

Column name of the child table. See remark section for composite key fields.

Remarks

To support composite primary keys (the primary key of each table consists of two or more columns) for the relation, you can simple separate the individual column names by tab character '\t' for the parameters parentColumName and childColumnName.

Example
OleDbCommand command = new OleDbCommand("Select * from [Customers]", conn);
OleDbCommand command2 = new OleDbCommand("Select * from [Orders]", conn);

DbCommandSetDataProvider provider = new DbCommandSetDataProvider();
provider.AddCommand(command, "Customers");
provider.AddCommand(command2, "Orders");
provider.AddRelation("Customers2Orders", "Customers", "Orders", "CustomerID", "CustomerID");

LL.DataSource = provider;
LL.Design();

Requirements

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

See Also