localdb

When does LocalDB unlock the mdf file?

不问归期 提交于 2019-12-13 05:14:10
问题 Question: I create a copy of an mdf file with a random name. I inject that name into the connect string used by an EF6 DbContext. It opens fine, I run queries, etc, then I dispose of the context. At this point if I attempt to delete the temp mdf file from the file system I cannot delete it; I get a "file is in use by another process" error. Does anyone know if it's possible to force the connection to drop the lock on the mdf file when the connection closes? Or when the SqlExpress engines

Can I connect to LocalDB MDF file on computer from a web app that is being run on a web server?

对着背影说爱祢 提交于 2019-12-13 03:07:55
问题 In development, i.e., when using Visual Studio and its built-in IIS Express instance, I have set up my web app to use LocalDB, with the data MDF file located in a directory on my computer but not inside the project directory, e.g., "C:\MyAppData\MyAppData.mdf", not "C:[...]\MyAppProject\App_Data\MyAppData.mdf." This is working just fine when using Visual Studio/IIS Express, and the connection string being used looks something like this: <add name="MyAppEntities" connectionString="metadata=res

Is it possible to have a relation where the foreign key is also the primary key?

我的梦境 提交于 2019-12-12 21:28:09
问题 I have a table in a SQL database which should have a relation with one of two tables, but not both. My manager solved it by using the ID field of the table Competitor as both primary key and as foreign key for the two other tables. None of the tables have autoincremental IDs. Problem is, when I try to add a new compeitor, it fails unless there is an entry in both of the other tables with the specified ID, which is the opposite of what I want. Here is an illustration to show you how it's done:

LocalDB and Entity Framework 6 - Security

旧时模样 提交于 2019-12-12 12:24:21
问题 I am trying to figure out a way to use a LocalDB in place of SQL for integration testing of EF6 queries (this would allow us to run integration tests on our build server). It seems like I should be able to replicate my database in SQL Express, detach, and import into my test project. I would expect from there I can modify my connection string in my test project to hit the local database file. I am running into a security issue though. I need to get SQL security working to pass in a user id

Service Broker Or SqlDependency in SqlLocalDb?

别来无恙 提交于 2019-12-12 11:01:32
问题 Is SqlDependency supported in SqlLocalDb ? If yes how to enable it? 回答1: Answering the question about Service Broker in your subject. Service Broker should work fine in LocalDB, but only local queues are available. Remote queues won't work, in either direction (in fact Service Broker queues are bi-directional, so there's no incoming/outgoing queue distinction). 回答2: I dont know exactly but may be below link can be useful for you: http://msdn.microsoft.com/en-us/library/bb934450.aspx 来源: https

Can't create an index catalog in localdb v\11.0

感情迁移 提交于 2019-12-12 10:31:26
问题 SQL statement: CREATE TABLE [dbo].[indexTable] ( [mapId] VARCHAR (50) NOT NULL, [keyword] VARCHAR (900) NULL, PRIMARY KEY CLUSTERED ([mapId] ASC) ); Go CREATE FULLTEXT CATALOG FTSearch This is the error I get Creating [FTSearch]... SQL72014: .Net SqlClient Data Provider: Msg 9982, Level 16, State 100, Line 1 Cannot use full-text search in user instance. I am using localdb\v11.0 that is installed along with visual studio 2012. 回答1: localdb\v11.0 does not support fulltext index. I installed MS

Find database of Web API project on Visual Studio 2015 LocalDB

十年热恋 提交于 2019-12-12 02:53:49
问题 I'm developing a Code First Web API using ASP.NET 5 and MVC 6. I can test my models and controllers locally and in Azure using a publish profile, but I want to see if the database is applying some constraints. I read that I can see the database's Tables and Columns using the SQL Server Object Explorer. When I go to View > SQL Server Object Explorer I can see the following: (localdb)\MSSQLLocalDB (localdb)\ProjectsV12 (localdb)\v11.0 I know that v11.0 was used on VS 2012 and it was changed to

Concurrent use of LocalDB on a network drive(s)

北城以北 提交于 2019-12-12 01:16:09
问题 My configuration is as follows: Server with Z: mapped to d:\something Client with Z: mapped to \\server\ A LocalDB MDF (and the whole application) located at Z: Either computer alone is OK, but doesn't work simultaneously. I get an exception saying System.Data.SqlClient.SqlException 0x80131904 Cannot open database z:\xxx\xxx.mdf requested by the login. the login failed. 回答1: This cannot be done. SQL requires than physical file attached to the database should be opened exclusively by the

Unable to connect to LocalDB

徘徊边缘 提交于 2019-12-11 12:03:31
问题 I'm trying to connect to LocalDB in Visual Studio 2015. I have LocalDB installed, but when I attempt to connect to (localdb)\MSSQLLocalDB it states that it isn't even there. Can anyone assist? I can't even find it in SSMS 2014. Update: Error message that I receive: 回答1: I am using Visual Studio Community 2015. Tools > Connect to Database Choose Microsoft SQL Server Data Provider will be .NET Framework Data Provider for SQL Server Continue Server name should be (localdb)\MSSQLLocalDB Click on

LocalDB connection with Integrated security=False

谁说我不能喝 提交于 2019-12-11 10:39:31
问题 I was looking everywhere and still have not found clear answer to this simple question: Is it possible to use SQL authentication with LocalDB, i.e. is it possible to use connection string containing Integrated Security=False ? 回答1: Yes, last I tried it was possible. Just follow the steps from this MDSN article. Keep in mind that it will still be user instance, running under the account that started it, and will be shut down shall the account log out. Also no remote access. 来源: https:/