Never used LocalDB before

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

1) Is LocalDB only used for testing, or is it sometimes ported to a live environment? 2) I notice that the connection string changes from PC to PC. For example, 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 the data source is different on every PC. How do you know which data source the client PC has?

3) Does the client PC have to install SQL Server Express for the application to work?

+3


source to share


1 answer


  • Yes, LocalDB is really used for testing. While there is nothing stopping you from using it in production, it will not be supported.
  • The data source is different in that LocalDB can still run different instances. You can manage them with a command line tool like:

    List of all instances:

    SqlLocalDB info
    
          

    Create a new instance:

    SqlLocalDb create MyLocalDb
    
          

  • No, LocalDB is completely separate from SQL Server Express



I recommend 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/

+1


source







All Articles