🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
MDrivenServer, opening the built-in database
This page was created by Lars.olofsson on 2018-07-22. Last edited by Wikiadmin on 2026-07-29.

You can inspect the built-in SQL Server Compact database used by MDrivenServer when you administer a self-hosted installation or need to examine its modeled and administration tables.

Database file and scope

MDrivenServer uses a SQL Server Compact database by default. The database file is:

__MDrivenServer/App_Data/DatabaseCompact.sdf

MDrivenServer receives a model from MDriven Designer and creates or evolves the database used to store the model's data. This page applies to the built-in DatabaseCompact.sdf file. If your installation uses another database through a connection string, use the tools for that database instead; for example, see Documentation:PostgreSQL.

Open DatabaseCompact.sdf with LINQPad

Use LINQPad to open and inspect the .sdf file.

  1. Stop the web server before copying or replacing the database file. On a Windows installation, stop the site or application through IIS Manager. For an Azure site, stop the site before downloading the file through Advanced Tools.
  2. Make a backup copy of __MDrivenServer/App_Data/DatabaseCompact.sdf before editing it.
  3. Open the copied DatabaseCompact.sdf file in LINQPad.
  4. When LINQPad asks for a driver, select SQL CE 4.0.
  5. Inspect the required tables or make the required change in the copied database.
  6. If you changed the database, replace the server's database file with the updated copy, then restart the website or IIS.

Do not replace the database while MDrivenServer is running. Keep the backup until you have confirmed that the server starts and the expected data is available.

If LINQPad cannot find SQL CE 4.0

Install the Microsoft SQL Server Compact 4.0 database driver, then restart LINQPad and select SQL CE 4.0 again.

Identify the tables

The database contains both your modeled application data and MDrivenServer's own administration data. Use the table prefix to distinguish them.

Prefix Contains Example use
A0_ The modeled database for slot A0 Inspect data created from the model deployed from MDriven Designer.
Admin_ MDrivenServer administration data Inspect server user and global-settings records when following an administration procedure.

For example, a table beginning with A0_ belongs to the deployed model, while a table beginning with Admin_ belongs to MDrivenServer administration. Do not treat the administration tables as application tables.

Use this procedure for account recovery

Opening the built-in database is one recovery option when you are locked out of a self-hosted MDrivenServer. Follow Documentation:MDrivenServer, Lost password or locked out for the supported recovery steps, including the preferred PwdReset.txt method and the procedure for unlocking an account in the administration database.

If a MDriven Turnkey application connects to this MDrivenServer, update its configured MDrivenServer password after a password reset. Otherwise, repeated login attempts with the old password can lock the account again. See Documentation:Set up MDriven Turnkey on premise for the on-premise Turnkey configuration.

See also