I am trying the Dev Express demo application located in
C:\Users\Public\Documents\DevExpress Demos 15.2\DevExtreme\DXHotels
Web.config has the connection string
<add name="DXHotelsStore" connectionString="data source=(localdb)\devextreme;attachdbfilename=|DataDirectory|\HotelDB.mdf;integrated security=True;multipleactiveresultsets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
The data file exists at
C:\Users\Public\Documents\DevExpress Demos 15.2\DevExtreme\DXHotels\App_Data\HotelDB.mdf
The solution file is in
C:\Users\Public\Documents\DevExpress Demos 15.2\DevExtreme\DXHotels
I don't understand why the location (localdb)\devextreme translates to the folder that the .mdf is in.
When I run the solution how does it work out the location?
[Update] The question here explains why the database is created in the App_Data folder but it does not explain why (localdb)devextreme is used.
[Update] The following questions are also relevant My support question at Dev Express My question about log files
Nikolai at DevExpress support answered
"v11.0" is the generic SQL Server Express LocalDb instance which is created when a LocalDB is installed. Since the name of this instance depends on the current version of Visual Studio, it may cause problems when launching our demos. That is why we do not use this name in our connection strings. To resolve this issue, we chose our own instance name which is created while building demo projects. See the Build Events tab in the demo project settings.
I checked in the build events and the Post-build event command line is
sqllocaldb create "devextreme" 2>nul 1>nul
sqllocaldb start "devextreme" 2>nul 1>nul
exit 0