0

I have a C#,.net application which connects to a SQLexpress database.

I am changing the database to localDB.Now there are couple features like

  1. Database restore/backup - i have a common stored procedure in master and i call that for the same.
  2. get all databases in the server instance

for both of them the connection string is something like

 "Data Source=ConfiguarionDB;Initial Catalog=master;Integrated Security=True;"

But since i am moving to localdb , what should be the connection string ?

"Data Source=(localdb)\\v11.0;AttachDbFileName= D:\\ConfiguarionDB.mdf;Initial Catalog=master;Integrated Security=True;"

which doesn't work!. I am able to load the database and perform all other operations which doesn't involve master db(ofcourse connection string doesn't involve master db)

user1687824
  • 807
  • 2
  • 10
  • 24

1 Answers1

0

Try your connection string without using Initial Catalog. Like this

"Data Source=(localdb)\v11.0;AttachDbFileName=D:\ConfiguarionDB.mdf;Integrated Security=True;"