dotConnect for DB2 Documentation
Devart.Common Namespace / SelectStatement Class / Columns Property
Example

In This Topic
    Columns Property (SelectStatement)
    In This Topic
    Contains list of columns and expressions used in the select-list of the current SelectStatement object.
    Syntax
    'Declaration
     
    Public ReadOnly Property Columns As SelectColumnCollection
    public SelectColumnCollection Columns {get;}

    Property Value

    A SelectColumnCollection that represents list of columns and expressions used in the SELECT clause.
    Example
    The following example demonstrates how to use the Columns property.
    private void RefreshStatement(DB2SelectStatement stmt)
    {
      stmt.Clear();
      stmt.Columns.Add(new SelectColumn("ENAME"));
      stmt.Columns.Add(new SelectColumn("", "emp", "JOB", "j"));
      stmt.Columns.Add(new SelectColumn("test", "", "emp", "HIREDATE", "hd"));
    
      stmt.Tables.Add(new SelectTable("emp"));
    
      //select ENAME,emp.JOB j,emp.HIREDATE hd from emp
      string queryText = stmt.ToString();
    }
    Private Sub RefreshStatement(ByVal stmt As DB2SelectStatement)
      stmt.Clear()
      stmt.Columns.Add(New SelectColumn("ENAME"))
      stmt.Columns.Add(New SelectColumn("", "emp", "JOB", "j"))
      stmt.Columns.Add(New SelectColumn("test", "", "emp", "HIREDATE", "hd"))
      stmt.Tables.Add(New SelectTable("emp"))
      'select ENAME,emp.JOB j,emp.HIREDATE hd from emp
      Dim queryText As String = stmt.ToString
    End Sub
    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