Skip to main content
All docs
V25.1
  • 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.v25.1.dll

    NuGet Package: DevExpress.DataAccess

    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