Training Mode on SQL LocalDB?

I note that Training Mode only works when connected to an SQL Express DB. As I notice training mode sets up a new database and updates connection string.

Is it possible to implement training mode with SQL LocalDB ? I read about the specification of LocalDB when I looking into it and read that you can have multiple databases connected to a LocalDB instance, just in the same way you can with a full SQL instance. Therefore I thought it might be possible to have training mode implemented this way?

I know it is possible to just copy the .mdf & .ldf files after SambaPOS has been closed, however although this worked fine for SQL CE, this is a bit problematic with LocalDB since the sqlservr.exe instance doesn’t terminate immediately after closing SambaPOS and appears to remain active for at least a few minutes (possibly more) afterwards, at which time you cannot copy those files as they’re locked, and personally I have end task of sqlservr.exe in task manager, which I am a bit concerned when doing so as unsure if it might cause any issue to the databases doing in such a way (haven’t had any issue so far but just saying…). I don’t think non technical users should be ending tasks of the database as I can foresee so so many problems occurring with that… :wink:

I think training mode is very convenient and useful for giving training or trying out a new feature on a live system, and if can be implemented with LocalDB would be quite beneficial to all.

It works for Local DB?

No training mode doesn’t at the moment work with LocalDB, I am asking if possible to add this support?

I read when I was investigating about LocalDB that you can have multiple databases within the LocalDB instance, just like the standard SQL Server, so thought it might be possible for you to implement in a similar way?

Seems working fine for me. What it does when you try to enable training mode?

Hmm… I am using the default LocalDB setup so has blank DB string.

SambaPOS5.mdf and SambaPOS5.ldf were placed in C:\Users<user>\ by the installer.

Training Mode buttons are disabled:

Is it because I am using the default instance and not providing a connection string? Actually I wasn’t sure what connection string to use for LocalDB since I don’t think it is mentioned anywhere on the forum.

Yeah, it would appear to be… If I use a connection string to connect to the same LocalDB, it works:

Maybe it would be good to fix it so it also works where LocalDB is default using blank connection string, as this is the way the installer sets it up?