I am trying to run DXHolels from the demo solution.
I notice that a database containing data does get installed, however initially there was no log file.
The first time I ran the solution a log file did get created however the application terminated with a threading error.
The next time I tried to run the application I got an error
C#Cannot create file 'C:\\Users\\Public\\Documents\\DevExpress Demos 15.2\\DevExtreme\\DXHotels\\App_Data\\HotelDB.mdf' because it already exists. Change the file path or the file name, and retry the operation.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors."
Why is it trying to re-create the database?
How do I get the demo to run correctly?
I did try re-installing DevExtreme.
.
[Update]
I have been asking related questions on Stack overflow
Hi Kirsten,
The issue sounds strange. I could not reproduce it on my side. Would you please send us a screencast that demonstrates how we can reproduce the issue step by step? We will do our best to assist you.
To reproduce the problem just install the 15.4 demos and try running DXHotels. I think possibly the issue is to do with the log file not being included in the install. Also possibly the connection string should have (LocalDb)\v11.0 instead of (LocalDb)\DevExtreme
I have worked around the issue by changing the connection string to use (LocalDb)\v11.0 and letting the app create a new database. I pulled in the Cities table from the problem database but it is hard work to write queries to import each table. Could you send me a zip containing the database and its log file?
Kirsten,
I was not able to reproduce the issue on my side. The HotelDB_log.ldf file should be created automatically by your SQL Server Express. In any case, I've attached the HotelDB.mdf and HotelDB_log.ldf files and a screencast that demonstrates how the demo operates on my side. Please test them and let me know your results.
Thanks Nikolai
The data in the attachment works correctly. So I am puzzled as to why the demo did not install correctly.
Can you tell me the DXHotelsStore connection string in your app.config?
Kirsten,
>>Can you tell me the DXHotelsStore connection string in your app.config?
Yes, sure. Here is my 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" />
This connection string also works for me.
Can you explain the significance of (localdb)\devextreme ?
Usually I see examples where it is (localdb)\v11.0
Kirsten,
"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.
See also:
(localdb)\Projects and (localdb)\v11.0
Thanks Nikolai, that explains it.
My pleasure :)