localdb

ASP.Net Core : Cannot open localdb requested by the login

拟墨画扇 提交于 2019-12-08 08:43:09
问题 Prompt: An unhandled exception occurred while processing the request. SqlException: Cannot open database "MoviesContext-8287b737-12b5-4c1c-8bf5-6259ea1d208b" requested by the login. The login failed. Login failed for user 'D-PC\D'. System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, object providerInfo, bool redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, bool

ClickOnce Custom Prerequisite for SQL Server Express 2016 LocalDB?

荒凉一梦 提交于 2019-12-08 05:14:16
问题 I'd like to set LocalDB 2016 as pre-requisite when publishing my WPF application. But when I check default pre-requisites in Project Properties, only one available is for SQL Server 2012 Express LocalDB. Any idea why there is no newer one, since I'm using newest possible Visual Studio 2017? Thank you! 回答1: From the few resources available i've found this post by @PaulBrewer, which saved the day. Since it's easier to just download a working solution, i've uploaded my own custom MSSSQL Express

ClickOnce Custom Prerequisite for SQL Server Express 2016 LocalDB?

社会主义新天地 提交于 2019-12-08 02:28:26
I'd like to set LocalDB 2016 as pre-requisite when publishing my WPF application. But when I check default pre-requisites in Project Properties, only one available is for SQL Server 2012 Express LocalDB. Any idea why there is no newer one, since I'm using newest possible Visual Studio 2017? Thank you! From the few resources available i've found this post by @PaulBrewer, which saved the day. Since it's easier to just download a working solution, i've uploaded my own custom MSSSQL Express LocalDB (2016) Bootstrapper/Manifest for anyone to use. Just follow instructions in readme.md: https:/

Sql Server LocalDB Issue In Asp.NET MVC 4 Project

寵の児 提交于 2019-12-08 01:03:53
问题 I am getting the following error whenever I am trying to open the db_name.mdf file: The database '{path}\db_name.MDF' cannot be opened because it is version 706. This server supports version 662 and earlier. A downgrade path is not supported. Could not open new database 'db_name.MDF'. CREATE DATABASE is aborted. An attempt to attach an auto-named database for file {$path}\db_name.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC

Visual Studio 2012 Code First still uses SQLEXPRESS by default

做~自己de王妃 提交于 2019-12-07 02:38:12
问题 I created a brand new Web API project, created a simple Code First model (one class with an id and the dbcontext object, and that's it), and ran Enable-Migrations in the package manager console. I noticed that it creates the database in SQLEXPRESS rather than LocalDB, despite the DefaultConnection string pointing to (LocalDB) in the Web.config file. This causes subsequent queries to fail, claiming that the database hasn't been initialized. How do I get the Enable-Migrations command in VS 2012

Sql Server LocalDB Issue In Asp.NET MVC 4 Project

守給你的承諾、 提交于 2019-12-06 14:15:36
I am getting the following error whenever I am trying to open the db_name.mdf file: The database '{path}\db_name.MDF' cannot be opened because it is version 706. This server supports version 662 and earlier. A downgrade path is not supported. Could not open new database 'db_name.MDF'. CREATE DATABASE is aborted. An attempt to attach an auto-named database for file {$path}\db_name.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. Connection string as follows: <add name="PasswordDBContext" connectionString="Data Source=(LocalDB)

Azure storage emulator cannot connect to LocalDB

风流意气都作罢 提交于 2019-12-06 09:44:58
I have a problem with the Azure storage emulator, which refuses to connect to LocalDb. It used to work just fine before I created an ODBC connection to it using the named pipe. What happened: I needed to access the data in my database from Mathematica, so I generated an ODBC connection. ODBC could not connect to (localdb)\v11.0, so I used a named pipe instead. Since then, Azure has stopped to work. I upgraded to SDK2.0, but it did not help. I tried to run DSInit.exe, but I get: Found SQL Instance (localdb)\v11.0. Creating database DevelopmentStorageDb20 on SQL instance '(localdb)\v11.0'.

Keyword not supported: 'data source'.: EF code-first using ObjectContext and LocalDB

旧时模样 提交于 2019-12-06 09:11:16
问题 I am getting a "keyword not supported error" when I try to connect to a LocalDB database using ObjectContext. This is my connection string: <add name="connStr" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=proj1db;Integrated Security=True" /> and this is the code that tries to create an instance of the ObjectContext: var connectionString = ConfigurationManager .ConnectionStrings["connStr"] .ConnectionString; ObjectContext _context = new

Creating a UNIQUE Filtered Index for NULL values on Entity Framework

一世执手 提交于 2019-12-06 08:02:54
问题 I'm trying to create a table that has a UNIQUE Filtered Index for NULL values (eg. Allow Null values to be duplicates) using Entity Framework. I am using Fluent API and have this entity property: modelBuilder.Entity<Client>().Property(c => c.Barcode) .HasMaxLength(20) .IsRequired() .HasColumnAnnotation( IndexAnnotation.AnnotationName, new IndexAnnotation(new IndexAttribute("IX_ClientBarcode") { IsUnique = true })); I found that SQL Server 2008 allows this for unique columns with filtered

Cannot attach the file as database / The underlying provider failed on Open

拈花ヽ惹草 提交于 2019-12-06 03:19:20
问题 I have an MVC3 application using the Entity Framework. I haven't used this application in about a year. Recently, I opened it up on a new PC and tried to run in debug mode and hit the following exception/stack trace in debug. The main exceptions seem to be "Cannot attach the file as database" and "The underlying provider failed on Open". I searched for these errors on stack overflow and the answers I found don't seem to match this situation. For example, one of the answers for "Cannot attach