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
 

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)
See Also