QueryByAttribute.TopCount QueryByAttribute.TopCount QueryByAttribute.TopCount QueryByAttribute.TopCount Property


Gets or sets the number of rows to be returned.

 property Nullable<int> TopCount { Nullable<int> get(); void set(Nullable<int> value); };
public Nullable<int> TopCount { get; set; }
member this.TopCount : Nullable<int> with get, set
Public Property TopCount As Nullable(Of Integer)

Property Value

Type: Int32The number of rows to be returned.


public void TestQueryByAttributeWithTopCount()
         QueryByAttribute query = new QueryByAttribute();
         query.EntityName = "Account";
         query.ColumnSet = new Microsoft.Xrm.Sdk.Query.ColumnSet(new string[] { "name" });
         query.AddAttributeValue("address1_city", "seattle");
         query.TopCount = 3;


When specified, this limits the number rows returned in a query result set to the specified number of rows.

A query can contain either PageInfo or TopCount property values. If both are specified, an error will be thrown.

Applies to