Skip to main content
All docs
V23.2

SelectQueryFluentBuilder.Join(String, SqlJoinType, RelationColumnInfo[]) Method

Joins two tables. Allows you to specify the join operation type and columns relations by which the tables should be joined.

Namespace: DevExpress.DataAccess.Sql

Assembly: DevExpress.DataAccess.v23.2.dll

NuGet Packages: DevExpress.DataAccess, DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap

Declaration

public SelectQueryFluentBuilder Join(
    string tableName,
    SqlJoinType joinType,
    params RelationColumnInfo[] keyColumns
)

Parameters

Name Type Description
tableName String

The name of the table with which the current table of the query builder should be joined.

joinType SqlJoinType

The join operation type.

keyColumns RelationColumnInfo[]

An array of column relations.

Returns

Type Description
SelectQueryFluentBuilder

A query builder that contains the join operation result.

Example

using DevExpress.DataAccess.Sql;
// ...
var query = SelectQueryFluentBuilder
    .AddTable("Customers")
    .SelectColumns("ContactName", "City")
    .Join(tableName: "Employees",
        joinType: SqlJoinType.Inner,
        keyColumns: new[] {
            new RelationColumnInfo(
                parentKeyColumn: "City",
                nestedKeyColumn: "City",
                conditionType: ConditionType.NotEqual),
            new RelationColumnInfo(
                parentKeyColumn: "Region",
                nestedKeyColumn: "Region"
                )})
    .Build("Customers");
See Also