Skip to main content
All docs
V24.2

SelectQueryFluentBuilder.Join(String, String, SqlJoinType, String, String) Method

Joins two tables. Allows you to specify a table alias, the join operation type, and column names by which the tables should be joined.

Namespace: DevExpress.DataAccess.Sql

Assembly: DevExpress.DataAccess.v24.2.dll

Declaration

public SelectQueryFluentBuilder Join(
    string tableName,
    string tableAlias,
    SqlJoinType joinType,
    string parentColumnName,
    string nestedColumnName
)

Parameters

Name Type Description
tableName String

The name of the table (nested table) with which the current table (parent table) of the query builder should be joined.

tableAlias String

A table alias.

joinType SqlJoinType

The join operation type.

parentColumnName String

The parent table column name.

nestedColumnName String

The nested table column name.

Returns

Type Description
SelectQueryFluentBuilder

A query builder object that contains the join operation result.

Example

using DevExpress.DataAccess.Sql;
// ...
var query = SelectQueryFluentBuilder
    .AddTable("Categories")
    .SelectColumns("CategoryName", "CategoryID")
    .Join(tableName: "Products",
        tableAlias: "Products1",
        joinType: SqlJoinType.Inner,
        parentColumnName: "CategoryID",
        nestedColumnName: "CtgID")
    .SelectColumn("ProductName")
    .Join(tableName: "Products",
        joinType: SqlJoinType.LeftOuter,
        keyColumnName: "ProductName")
    .SelectColumn("UnitPrice")
    .Build("Categories");
See Also