Chili.Opf3 Send comments on this topic.
FieldAttribute Class
See Also  Members   Example 
Chili.Opf3 Namespace : FieldAttribute Class




This attribute is used to connect a property with a field in the storage.

Syntax

Visual Basic (Declaration) 
Public NotInheritable Class FieldAttribute 
   Inherits Attribute
Visual Basic (Usage)Copy Code
Dim instance As FieldAttribute
C# 
public sealed class FieldAttribute : Attribute 
Managed Extensions for C++ 
public __gc __sealed class FieldAttribute : public Attribute 
C++/CLI 
public ref class FieldAttribute sealed : public Attribute 

Example

The following example shows how to use the FieldAttribute in a persistent class.
C#Copy Code
            [Persistent("USER")] 
public class User 

    [Field("NAME", AllowDBNull = false)] 
    public string Name 
    { 
        // ... code of the property. 
    } 
  
    [Field("ID", AllowDBNull = true, Identifier = true)] 
    public string Id 
    { 
        // ... code of the property. 
    } 
  
    // ... Other code of the class. 

    

Remarks

The FieldAttribute is used to mark properties of the persistent class. Each property marked with this attribute corresponds to a field in the storage. The first argument that is passed to the attribute is the name of the field (in the entity) in the storage. After specifying the field optional properties may be set, which specify whether the field is an identifier, allows DBNull or is an auto number field field. By specifying the property PersistBehaviours it is also possible to specify whether the property should be always saved or only if inserted or updated.

Inheritance Hierarchy

System.Object
   System.Attribute
      Chili.Opf3.FieldAttribute

Requirements

Namespace: Chili.Opf3

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Chili.Opf3 (in Chili.Opf3.dll)

See Also