dotConnect for MySQL Documentation
Devart.Data.MySql Namespace / MySqlSelectStatement Class / Limit Property
Example

In This Topic
    Limit Property
    In This Topic
    Gets or sets the LIMIT clause for the statement.
    Syntax
    'Declaration
     
    Public Property Limit As MySqlSelectLimit
    public MySqlSelectLimit Limit {get; set;}

    Property Value

    The LIMIT clause for the statement.
    Example
    The following example demonstrates how to use the Limit property.
    MySqlSelectStatement stmt = new MySqlSelectStatement();
    stmt.Columns.Add(new SelectColumn("ENAME"));
    stmt.Columns.Add(new SelectColumn("JOB"));
    stmt.Tables.Add(new SelectTable("emp"));
    
    stmt.Limit = new MySqlSelectLimit(5, 3);
    
    //select ENAME,JOB from emp limit 5,3 (6th, 7th, and 8th rows)
    MySqlCommand command = new MySqlCommand(stmt.ToString());
    Dim stmt As New MySqlSelectStatement
    stmt.Columns.Add(New SelectColumn("ENAME"))
    stmt.Columns.Add(New SelectColumn("JOB"))
    stmt.Tables.Add(New SelectTable("emp"))
    stmt.Limit = New MySqlSelectLimit(5, 3)
    
    'select ENAME,JOB from emp limit 5,3 (6th, 7th, and 8th rows)
    Dim command As New MySqlCommand(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