System.ComponentModel.DataObjectFieldAttribute Class

Provides metadata for a property representing a data field. This class cannot be inherited.

See Also: DataObjectFieldAttribute Members


public sealed class DataObjectFieldAttribute : Attribute


Use the System.ComponentModel.DataObjectFieldAttribute attribute to provide information about the schema of the underlying data. Design-time classes such as the System.Web.UI.Design.WebControls.ObjectDataSourceDesigner class use the System.ComponentModel.DataObjectAttribute attribute to set properties at design-time based on the exposed schema.

You apply the System.ComponentModel.DataObjectFieldAttribute attribute to members of the data item objects that are returned by the Select method of an object marked with the System.ComponentModel.DataObjectAttribute attribute. In the following example, the NorthwindData class is marked with the System.ComponentModel.DataObjectAttribute attribute, and returns an IEnumerable object containing NorthwindEmployee objects from the GetAllEmployees method. Fields in the NorthwindEmployee class are marked with the System.ComponentModel.DataObjectFieldAttribute attribute to indicate they represent data fields in the underlying data source.

For more information about using attributes, see Extending Metadata Using Attributes.


Namespace: System.ComponentModel
Assembly: System (in System.dll)
Assembly Versions:,