Ninja Database Pro
IndexFileSize Property
Example 



KellermanSoftware.NinjaDatabasePro Namespace > NinjaDbPro Class : IndexFileSize Property
Get the size of the index file in bytes. This is for the indexes and table definitions.
Syntax
Public ReadOnly Property IndexFileSize As Long
Dim instance As NinjaDbPro
Dim value As Long
 
value = instance.IndexFileSize
public long IndexFileSize {get;}
public:
property int64 IndexFileSize {
   int64 get();
}
Example
NinjaDbPro db = new NinjaDbPro("MyDatabaseDirectory", "MyDatabaseName");
             
            //Licensed Mode
            //db.UserName = "John Smith 101224";
            //db.LicenseKey = "aousdf832jasf==";
             
            //Set before OpenDatabase. Default storage is IsolatedStorageDatabase. Other options are:
            //db.Storage = new MemoryDatabase(); //In memory database
            //db.Storage = new FileDatabase();  
             
            db.OpenDatabase();
             
            Person person1 = new Person();
            person1.DateCreated = DateTime.Now;
            person1.Name = "John Smith";
            db.Save(person1);
             
            //This is the size in bytes for the indexes and table definitions
            long indexFileSize = db.IndexFileSize;
             
            db.CloseDatabase();
Dim db As New NinjaDbPro("MyDatabaseDirectory", "MyDatabaseName")
             
            'Licensed Mode
            'db.UserName = "John Smith 101224";
            'db.LicenseKey = "aousdf832jasf==";
             
            'Set before OpenDatabase. Default storage is IsolatedStorageDatabase. Other options are:
            'db.Storage = new MemoryDatabase(); //In memory database
            'db.Storage = new FileDatabase();  
             
            db.OpenDatabase()
             
            Dim person1 As New Person()
            person1.DateCreated = Date.Now
            person1.Name = "John Smith"
            db.Save(person1)
             
            'This is the size in bytes for the indexes and table definitions
            Dim indexFileSize As Long = db.IndexFileSize
             
            db.CloseDatabase()
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

NinjaDbPro Class
NinjaDbPro Members