A newer version of this page is available. Switch to the current version.

XpoDataSource Class

A collection of persistent objects for ASP.NET controls.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v18.2.dll


[ToolboxTabName("DX.18.2: ORM Components")]
[ToolboxBitmap(typeof(XpoDataSource), "XPODataSource.bmp")]
public class XpoDataSource :
<ToolboxTabName("DX.18.2: ORM Components")>
<ToolboxBitmap(GetType(XpoDataSource), "XPODataSource.bmp")>
Public Class XpoDataSource
    Inherits DataSourceControl
    Implements IXPClassInfoProvider,


The XpoDataSource component is an XPCollection counterpart for ASP.NET controls. In essence, the XpoDataSource component retrieves persistent objects from a data store and can be bound to a visual data-aware control (e.g. ASPxGridView, ASPxNewsControl, ASPxCloudControl, etc.)

When creating an XpoDataSource, you should specify the type of objects to store. To do this, use the XpoDataSource.TypeName property.


Then, link the XpoDataSource to a session, which will be used to load and save persistent objects to a data store, via the XpoDataSource.Session property. For recommendations on how to create/destroy sessions, see Tutorial 6 - A Simple Guestbook (ASP.NET).

Use the XpoDataSource.Criteria property to change the criteria by which persistent objects will be filtered during collection loading on the server side.

XpoDataSource1.Criteria = "[Age] > ?";
XpoDataSource1.CriteriaParameters.Add("Age", TypeCode.Int32, "30");

For more information on how to retrieve specific data, see Connecting XPO to a Database Server (ASP.NET).


See Also