Ninja Database Pro
Creating A Database
Basic Tasks > Creating A Database

Databases are automatically created during the OpenDatabase method if they do not already exist.  Use the DoesDatabaseExist method to check if the database exists before executing the OpenDatabase method.

 

C# Example:

Db db = new Db("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(); //Valid only for non Silverlight projects

 

//This will be false the first time

bool databaseExists = db.DoesDatabaseExist();

 

db.OpenDatabase();

 

//This will be true

databaseExists = db.DoesDatabaseExist();

 

db.CloseDatabase();