Determine location of all database files

Jan 9, 2013 at 1:50 PM

I really like to keep the log files of my ESE database with the main file in one place.  Is there a way to tell the system to keep them together?

Exampe:  I have a sub-folder called "C:\myProgName\Bin\ESEdatabase" that holds the main database file with the extension of .edb.

However all the log files are stored in "C:\myProgName\Bin" folder.  The "Bin" folder is the starting point of the program execution.  I would like to tell the system to keep all database related files in "ESEdatabase" folder.

Can you suggest a way?

Thanks

Kamran

Developer
Jan 17, 2013 at 11:43 AM

InstanceParameters.SystemDirectory, InstanceParameters.TempDirectory, and InstanceParameters.LogFileDirectory.

Yes, it's annoying that you have to set multiple system parameters. It's for historical reasons (i.e. they might not make much sense now :).

-martin

Jan 17, 2013 at 2:10 PM

Martin,

Thank you very much for the reply.  This is a fantastic product and you are very nice to answer all these questions.  The following code is an example for anyone that needs code sample:

            instance = new Instance("DatabaseNameHere");

            Directory = "SubFolderName";
            instance.Parameters.LogFileDirectory = Directory;
            instance.Parameters.TempDirectory = Directory;
            instance.Parameters.SystemDirectory = Directory;
            instance.Parameters.CreatePathIfNotExist = true;

            // Create the instance, database and table
            instance.Init();

Also look at discussion http://managedesent.codeplex.com/discussions/356581 for better example.

Kamran