w0051977
w0051977

Reputation: 15817

Never used LocalDB before

I have never used LocalDB in an application before. I have two questions:

1) Is LocalDB used for testing only or is it sometimes rolled out to the live environment? 2) I notice that the connection string varies from PC to PC. For example, please see the connection string below which works on my desktop PC (with Visual Studio 2013):

Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\dbCurrency.mdf;Integrated Security=True

and the connection string below, which works on my Tablet PC (with Visual Studio Community 2015):

Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\dbCurrency.mdf;Integrated Security=True

Why is the data source different on each PC. How do you know, which data source the client PC has?

3) Does the client PC have to have SQL Server Express installed for the app to work?

Upvotes: 3

Views: 100

Answers (1)

DavidG
DavidG

Reputation: 119017

  1. Yes, LocalDB is really used for testing. While there's nothing preventing you from using it in a production environment, it's not going to be supported.
  2. The data source is different because LocalDB can still run distinct instances. You can manage these with the command line tool, for example:

    List all instances:

    SqlLocalDB info
    

    Create new instance:

    SqlLocalDb create MyLocalDb
    
  3. No, LocalDB is completely separate from SQL Server Express

I recomend reading this MSDN article which has a good introduction to LocalDB: https://blogs.msdn.microsoft.com/sqlexpress/2011/07/12/introducing-localdb-an-improved-sql-express/

Upvotes: 1

Related Questions