dotConnect for PostgreSQL Documentation
Devart.Common Namespace / SelectStatement Class / ToString Method
Example

In This Topic
    ToString Method (SelectStatement)
    In This Topic
    Returns SQL statement in the text form.
    Syntax
    'Declaration
     
    Public Overrides Function ToString() As String
    public override string ToString()

    Return Value

    The text of SQL statement that is equivalent to current state of the SelectStatement object.
    Example
    The following example demonstrates how to use the ToString method.
    PgSqlSelectStatement stmt = new PgSqlSelectStatement();
    stmt.Columns.Add(new SelectColumn("JOB"));
    stmt.Tables.Add(new SelectTable("emp"));
    
    stmt.Distinct = true;
    
    //select distinct JOB from emp
    string queryText = stmt.ToString();
    Dim stmt As New PgSqlSelectStatement
    stmt.Columns.Add(New SelectColumn("JOB"))
    stmt.Tables.Add(New SelectTable("emp"))
    stmt.Distinct = True
    
    'select distinct JOB from emp
    Dim queryText As String = stmt.ToString
    See Also