localdb

How to prevent SQL Server LocalDB auto shutdown?

久未见 提交于 2019-11-26 15:36:08
问题 I'm using SQL Server 2012 Express LocalDB. Instances seem to stop automatically after 10 minutes if there is no activity on them. Is there a clean way to keep an instance running forever? 回答1: The timeout is configurable via T-SQL with 'user instance timeout' option: sp_configure 'show advanced options', 1; RECONFIGURE; GO sp_configure 'user instance timeout', 5; GO The timeout is expressed in minutes and has a maximum value of 65535 . I'm pretty sure you need to restart the instance after

What is the connection string for localdb for version 11

一笑奈何 提交于 2019-11-26 15:21:22
I'm trying to do the Code First Walkthrough of the entity framework ( http://blogs.msdn.com/b/adonet/archive/2011/09/28/ef-4-2-code-first-walkthrough.aspx ). I have the latest SQL Server Express and when I check my versions available via command line ( sqllocaldb info ): I see localdbApp1 and v11.0. When I try to run the walkthrough with a few minor tweaks, I get a can't connect error. My app.config looks like this: <parameter value="Server=(LocalDB)\v11.0; Integrated Security=True; MultipleActiveResultSets=True" /> I wrote a simple connection test like below and the code returns the same SQL

EF5: Cannot attach the file ‘{0}&#39; as database &#39;{1}&#39;

为君一笑 提交于 2019-11-26 14:52:54
I'm encountering the exact issue as described here (read section "Cannot Attach to Deleted MDF File"), but the solution to the problem is not told there... In short the issue is that after deleting the .mdf file, the following exception is thrown when I try to access the DB using EF 5.0. DataException->EntityException->SqlException: Cannot attach the file ‘{0}' as database '{1}' I did delete the DB file and now I get that nasty error message when running the application expecting it to use it's initializer. Any way to fix this? CodingWithSpike If you delete the DB file, it still stays

How to connect to LocalDB in Visual Studio Server Explorer?

落花浮王杯 提交于 2019-11-26 13:52:48
I can't believe I couldn't find a working solution to this after an hour of searching. I'm following this article on Entity Framework 6.0 which gives a simple walk-through on Code First. I created the project and installed the latest EF Nuget package for the project to compile. I also verified that I have Microsoft SQL Server 2012 Express LocalDB installed which came with Visual Studio 2013. I don't have any other instances of SQL installed on my local computer. The program runs and entries are added to the database and outputted in the console. But when the article says "check your localdb"

LocalDB SQL Server 2014 Express creates 2 instances (localdb)\ProjectsV12 & (localdb)\MSSQLLocalDB?

旧街凉风 提交于 2019-11-26 12:24:26
问题 I\'m using SQL Server 2014 Express and the LocalDB option, and I have the following in my SQL Server object explorer pane in Visual Studio 2013... So what is the difference between (localdb)\\ProjectsV12 & (localdb)\\MSSQLLocalDB ? 回答1: The (localdb)\ProjectsV12 and (localdb)\ProjectsV13 instances are created by SQL Server Data Tools (SSDT) and should not be used by applications (localdb)\MSSQLLocalDB is the SQL Server Express 2014/2016 LocalDB default instance name and an "automatic instance

SQL Server (localdb)\v11.0 explained

跟風遠走 提交于 2019-11-26 11:55:14
问题 I\'m following Code First to an Existing Database tutorial and noticed that it suggested to connect to (localdb)\\v11.0 in learning purposes. I\'ve tried to connect to it using my SQL Management Studio and it worked. But when I\'ve restored a DB backup it created an [DatabaseName].mdf file in my user\'s directory. I\'m quite surprised and have following questions: What is a (localdb)\\v11.0 ? Does it uses my SQL Express or SQL Compact? Does it support only databases stored in .mdf files? How

Connecting to SQL Server LocalDB using JDBC

荒凉一梦 提交于 2019-11-26 06:03:20
问题 Is it possible to connect to a SQL Server LocalDB using JDBC? It appears that (as of Dec 2011) it was not possible. Do you know of a workaround or change in status? 回答1: Is it possible to connect to a SQL Server LocalDB using JDBC? Not with Microsoft's JDBC Driver. The jTDS JDBC driver supports named pipes. Executing SqlLocalDB.exe info MyInstance will get you (along with other info) the instance pipe name such as "np:\.\pipe\LOCALDB#F365A78E\tsql\query". Do you know of a workaround or change

EF5: Cannot attach the file ‘{0}&#39; as database &#39;{1}&#39;

我与影子孤独终老i 提交于 2019-11-26 05:57:09
问题 I\'m encountering the exact issue as described here (read section \"Cannot Attach to Deleted MDF File\"), but the solution to the problem is not told there... In short the issue is that after deleting the .mdf file, the following exception is thrown when I try to access the DB using EF 5.0. DataException->EntityException->SqlException: Cannot attach the file ‘{0}\' as database \'{1}\' I did delete the DB file and now I get that nasty error message when running the application expecting it to

How to connect to LocalDB in Visual Studio Server Explorer?

為{幸葍}努か 提交于 2019-11-26 05:54:48
问题 I can\'t believe I couldn\'t find a working solution to this after an hour of searching. I\'m following this article on Entity Framework 6.0 which gives a simple walk-through on Code First. I created the project and installed the latest EF Nuget package for the project to compile. I also verified that I have Microsoft SQL Server 2012 Express LocalDB installed which came with Visual Studio 2013. I don\'t have any other instances of SQL installed on my local computer. The program runs and

How to install localdb separately?

前提是你 提交于 2019-11-26 04:45:07
问题 If I have to work with localdb , do we need to install it separately? I have SQL Server 2008 R2 Management Studio installed, SQL Server 2012 installed, .net 4.0.2 update installed. But I don\'t see localdb in the PC yet. 回答1: From MSDN The primary method of installing LocalDB is by using the SqlLocalDB.msi program. LocalDB is an option when installing any SKU of SQL Server 2012 Express. Select LocalDB on the Feature Selection page during installation of SQL Server Express . There can be only