ObjectDataSource.DataSource Property

Specifies the object data source that can be a specific object instance or a type.

Namespace: DevExpress.DataAccess.ObjectBinding

Assembly: DevExpress.DataAccess.v20.1.dll

Declaration

public object DataSource { get; set; }
Public Property DataSource As Object

Property Value

Type Description
Object

A Object value, specifying the data source.

Remarks

Because the Data Source wizard cannot be used for binding to a specific object instance, it is required to assign this instance to the DataSource property in code before calling the ObjectDataSource.Fill method. In the wizard, this scenario corresponds to the "Retrieve the data source schema" option.

If the DataSource property has been assigned a type, the ObjectDataSource will try to create an instance of this type when calling the ObjectDataSource.Fill method (this will require specifying the ObjectDataSource.Parameters property). In the wizard, this scenario corresponds to the "Retrieve the actual data" option.

If the ObjectDataSource.DataMember property has been assigned a static member, creating an instance of the corresponding type is not required, nor is specifying the constructor parameters.

See Also