dotConnect for SQL Server Documentation
Devart.Common Namespace / SelectStatement Class / Where Property
Example

In This Topic
    Where Property (SelectStatement)
    In This Topic
    Gets or sets WHERE clause of the statement.
    Syntax
    'Declaration
     
    Public Overridable Property Where As String
    public virtual string Where {get; set;}

    Property Value

    The WHERE clause of the statement.
    Remarks
    To quickly add new condition to the clause use the AddWhereCondition method.
    Example
    The following example demonstrates how to use the Where property.
    SqlSelectStatement stmt = new SqlSelectStatement();
    stmt.Columns.Add(new SelectColumn("ENAME"));
    stmt.Tables.Add(new SelectTable("emp"));
    
    stmt.Where = "1000 < SAL AND SAL < 1500 OR JOB = 'SALESMAN'";
    
    SqlCommand command = new SqlCommand(stmt.ToString());
    Dim stmt As New SqlSelectStatement
    stmt.Columns.Add(New SelectColumn("ENAME"))
    stmt.Tables.Add(New SelectTable("emp"))
    
    stmt.Where = "1000 < SAL AND SAL < 1500 OR JOB = 'SALESMAN'"
    
    Dim command As New SqlCommand(stmt.ToString)
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also