0

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

Community
  • 1
  • 1
Kirsten
  • 15,730
  • 41
  • 179
  • 318

2 Answers2

0

LocalDB is a developer-oriented database instance, which isn't an actual instance meaning that there's no service running. The advantage, from a developer's perspective, is that there's no installation or maintenance required, as it was previously had you used a SQL Server Express installation or any other full-type SQL Server edition. The caveat is that you don't get named pipes and everything is bounded to local connections. On the other hand, you still have the ability of creating named instances, which are also called LocalDB private instances - as usual, you can connect to them using (LocalDB)\. As there's no actuall attachment going on on the LocalDB side, specifying the databases's name acts as a "attach"-like process. Hope this helps.

Alex Mang
  • 26
  • 1
0

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
Kirsten
  • 15,730
  • 41
  • 179
  • 318