localdb

SQL LocalDB - Cannot delete a DB when its files are deleted

家住魔仙堡 提交于 2019-12-24 12:55:11
问题 How can I delete a SQL LocalDB database that has had its files delete? Dropping the database yields this message: Unable to open the physical file "C:\Users\Public\Documents\LocalDB.Tests.3d0d7339-7cf2-45fe-a83b-b5079112ab80.mdf". Operating system error 2: "2(The system cannot find the file specified.)". File activation failure. The physical file name "C:\Users\Public\Documents\LocalDB.Tests.3d0d7339-7cf2-45fe-a83b-b5079112ab80_log.ldf" may be incorrect. Running master.sp_databases actually

SqlLocalDB info lists two Instances with the same Name

家住魔仙堡 提交于 2019-12-24 12:22:03
问题 When my IIS MVC4 Web App (running as my user) tries to connect to a named LocalDb Instance it fails to start MyInstance or connect to it. I have the auto-create section in my Web.config and App.config of another services that uses the same database. I then manually create and start my named instance using SqlLocalDb create MyInstance -s I try again and get the same error. If I then do SqlLocalDb info, it shows 2 instances with the same name. If I stop and delete MyInstance, then there will

sql local db instance doesn't exist

懵懂的女人 提交于 2019-12-24 10:06:17
问题 I created an instance with Local System Account successfully. Then I checked the instance information with "info" command, all information of instance was shown. But after a few seconds I run "info" command again, the instance was deleted. Why was the instance deleted? localdb instance was deleted I have a window service run under Local System Account. This service can connect to SQL Local DB by using "MSSQLLocalDB" instance , but could not connect by using a private instance although the

Can't connect to Localdb but can using namedpipe

China☆狼群 提交于 2019-12-24 09:17:58
问题 I am really suck with connecting my app to a database. I am trying to connect to a database using (localdb)\MSSQLLocalDB in the connection string and I get this error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error

Cannot find file specified when dropping LocalDb database if .mdf was deleted

不羁岁月 提交于 2019-12-24 01:13:04
问题 I am trying to write an application that will create a local database if it's not found in the application's folder. I run this query after deleting the .mdf IF EXISTS (SELECT * FROM sys.databases WHERE name = N'Test_db') BEGIN DROP DATABASE Test_db END CREATE DATABASE Test_db ON PRIMARY (NAME=Test_db, FILENAME='...\Test_db.mdf') My command.ExecuteNonQuery() throws an exception, even though it drops the database and creates a new one. The error comes from the DROP DATABASE part of the command

Connecting to LocalDB Server in Navicat Premium

核能气质少年 提交于 2019-12-23 16:15:34
问题 Recently I installed LocalDb Serer on my laptop. I am trying to establish a connection between Navicat and LocalDB server. But unable to get the correct Host Name/IP Address for the LocalDB server. I noticed by default LocalDB server always creates an instance named MSSQLLocalDB when started. I've searched internet but couldn't find the exact solution for my problem in navicat premium software. Here is the error I am getting. Excuse me if I've posted this in the wrong forum. EDIT After some

Improve the performance of dacpac deployment using c#

痴心易碎 提交于 2019-12-23 12:52:35
问题 We are deploying to MS SQL Server localdb for integration testing. We build a Database Project and the resulting dacpac file is copied in order to be used by the IntegrationTests project. So far we have: DatabaseProject.sqlproj bin/debug/DatabaseProject.dacpac IntegrationTests.csproj bin/debug/DatabaseProject.dacpac We have an assembly setup in the IntegrationTests project where a new fresh database is created and the dacpac is deployed to localdb . In the TearDown the database is deleted so

nHibernate and SQL Server 2012 LocalDB

爷,独闯天下 提交于 2019-12-23 09:25:53
问题 Is it possible to use LocalDB databases with NHibernate? If yes, what should be installed/configured? Currently when trying to use connection string like Data Source=(LocalDb)\v11.0;Initial Catalog=tst1;Integrated Security=SSPI when creating SessionFactory I get System.Data.SqlClient.SqlException : A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and

How can I connect to local SQL Server if MSSQLSERVER service is missing?

这一生的挚爱 提交于 2019-12-23 04:44:00
问题 I am trying to do some local development on various toy projects for learning purposes. I have Microsoft SQL Server Management Studio 2008 R2 (10.50.1617.0) and Visual Studio Express 2013 for Web installed on my machine. Projects using things such as Membership and Entity Framework code-first approach are failing to create databases. SSMS is configured to make connections to an external server with a bunch of my company's DBs on it, but I cannot connect to the local machine's SQL Server

How to share a LocalDB instance across all projects in a solution?

爱⌒轻易说出口 提交于 2019-12-22 11:22:19
问题 I have a VS 2012 solution setup like this: EF Model Project EF Model Test Project ASP.NET MVC 4 Application WCF Data Services Project During development i want to use LocalDB as the backing database to EF. The MVC & WCF projects both use the EF Model to access the data in the database. I would like to share the same LocalDB instance across all projects (MVC, WCF, & Test) but can't seem to get the web.config's setup right. I'd also like this project setup to be portable across developers