Skip to main content
A newer version of this page is available. .
All docs
V21.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.v21.2.dll

NuGet Packages: DevExpress.DataAccess, DevExpress.Win.Design

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