Knight Data Access Layer
FillInMaintenanceFields Property (IDataHelper)
Example 




KellermanSoftware.NetDataAccessLayer Namespace > IDataHelper Interface : FillInMaintenanceFields Property
If true, properties such as CreateDate, UpdateDate, CreateUser will be automatically filled in before saving The default is true
Syntax
Property FillInMaintenanceFields As Boolean
Dim instance As IDataHelper
Dim value As Boolean
 
instance.FillInMaintenanceFields = value
 
value = instance.FillInMaintenanceFields
bool FillInMaintenanceFields {get; set;}
__property bool get_FillInMaintenanceFields();
__property void set_FillInMaintenanceFields( 
   bool value
);
property bool FillInMaintenanceFields {
   bool get();
   void set (    bool value);
}
Remarks
See also MaintFields
Example
//Get the current thread static safe instance of the helper
IDataHelper db = DataHelper.SessionFactory();
 
//Specify User Name and License Key from the receipt, leave blank for trial mode
//db.UserName = "John Smith 1234";
//db.LicenseKey = "asdfl219==";
 
//Enable Filling in Maint Fields (the default)
db.FillInMaintenanceFields = true;
 
//Log to the console
db.EnableLogging();
 
//Open the database connection
db.OpenConnection();
 
//Create a new Person to save to the database
Person currentPerson = new Person();
currentPerson.FirstName = "John";
currentPerson.LastName = "Smith";            
 
//Save it to the database 
db.Save(currentPerson);
 
//Create date will be automatically filled in because it is auto detected as a maintenance field by the name
//To see the full list of Maint fields do a get on DataHelper.MaintenanceFields
Console.WriteLine(currentPerson.DateCreated);
 
//Close the connection
db.CloseConnection();
'Get the current thread static safe instance of the helper
Dim db As IDataHelper = DataHelper.SessionFactory()
 
'Specify User Name and License Key from the receipt, leave blank for trial mode
'db.UserName = "John Smith 1234"
'db.LicenseKey = "asdfl219=="
 
'Enable Filling in Maint Fields (the default)
db.FillInMaintenanceFields = True
 
'Log to the console
db.EnableLogging()
 
'Open the database connection
db.OpenConnection()
 
'Create a new Person to save to the database
Dim currentPerson As New Person()
currentPerson.FirstName = "John"
currentPerson.LastName = "Smith"
 
'Save it to the database 
db.Save(currentPerson)
 
'Create date will be automatically filled in because it is auto detected as a maintenance field by the name
'To see the full list of Maint fields do a get on DataHelper.MaintenanceFields
Console.WriteLine(currentPerson.DateCreated)
 
'Close the connection
db.CloseConnection()
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

IDataHelper Interface
IDataHelper Members