5

I am investigating my experience of the issue here

When my Winforms XAF, Entity Framework Code First + Desktop Bridge application is installed via the Windows Store, it creates a database in the users directory.

If I delete the files then I will get an error when I try to re-run the application.

The underlying provider failed on Open

This is because I have not dropped the database properly.

As is explained in the linked issue.

I tried the fix of

sqllocaldb.exe stop MSSQLLocalDB
sqllocaldb.exe delete MSSQLLocalDB

But it did not fix the problem. Moreover I cannot find the SQL Server instance to connect to ( via Management Studio 2017 ) In order to drop the database.

I have the following folders under c:\Program Files\Microsoft SQL Server

folders for sql server

[Update]

I tried running

sqllocaldb.exe info mssqllocaldb 

which gives Version 13.1.4001.0

to get an instance pipe name to use to connect via SQL Server Object Explorer I was then able to create a new database of the same name, and then delete it. However this did not solve my problem.

[Update]

The connection string is

"Integrated Security=SSPI;MultipleActiveResultSets=True;Data Source=(localdb)\mssqllocaldb;Initial Catalog=mydatabase"

I have asked a related question here

I am now thinking that localdb is not supported for UWP

Kirsten
  • 15,730
  • 41
  • 179
  • 318
  • What does the connection string look like for the application? It would help in understanding where to look and how to access the store. – John Babb Dec 30 '18 at 11:55
  • Also [check here](https://stackoverflow.com/questions/21563940/how-to-connect-to-localdb-in-visual-studio-server-explorer) depending on what version of local db you have you might be able to figure it out. – John Babb Dec 30 '18 at 11:57
  • Thanks @JohnBabb I updated the question. – Kirsten Dec 30 '18 at 20:21
  • 1
    Kirsten, did you find an answer? I have a scorched earth approach I use when LocalDB instances get funky, involving deleting the instance directories, and the registry keys that point to them. If you still need help resolving this, I can give you the details. – Richard II Feb 14 '19 at 14:45
  • 1
    Thanks @RichardII After reading https://stackoverflow.com/questions/42028186/sql-server-express-vs-express-localdb I switched to SQLite – Kirsten Feb 14 '19 at 21:41

1 Answers1

0

With Management Studio 2017, if you run it as an admin, you should be able to connect to (localdb)\MSSQLLocalDB with a trusted connection. This should bring up the service that will give you visibility to what databases are attached. From there you should be able to drop/create... do what is needed to config and set the context of the database.

John Babb
  • 931
  • 10
  • 19