localdb

How to connect a localdb from Visual Studio to the published Azure web app?

匆匆过客 提交于 2019-11-29 17:15:29
So i have a localdb set up for my project in Visual Studio but when I publish it to my Azure web app, I get " An unhandled exception occurred while processing the request. Win32Exception: The system canot find the file specified TryGetConnection" I tried adding a "DefaultConnection" Connection String with the database/server as the value in the Web App settings but that didn't do anything yoape LocalDb doesn't exist for Azure. LocalDb is a feature of SQL Server Express, there is no equivalency of that on the service (machine) you are deploying your App Service website on. There are plenty of

Can I specify the filename for a localdb database in entity framework 5?

坚强是说给别人听的谎言 提交于 2019-11-29 12:02:05
问题 If I'm using Entity Framework 5 with LocalDb, is there a way of specifying the filename of the database in the app.config/web.config file? 回答1: On further investigation it looks like it is really simple, but isn't clear when reading the docs. First of all you need to have the entity framework part of the configuration <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> <parameters> <parameter value="v11.0" /> <

DACPAC won't deploy because 'can't connect to server'?

点点圈 提交于 2019-11-29 10:23:00
I'm trying to deploy a DACPAC to LocalDB 2012 but it's just not having it: Stack trace is as follows: ================================== Could not deploy package. (Microsoft.SqlServer.Dac) ------------------------------ Program Location: at Microsoft.SqlServer.Dac.DeployOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context) at Microsoft.SqlServer.Dac.OperationExtension.Execute(IOperation operation, Action`2 reportStatus, CancellationToken cancellationToken) at Microsoft.SqlServer.Dac.DacServices.InternalDeploy(IPackageSource packageSource, Boolean isDacpac, String

SQL LocalDb Automatic Instance Startup Failure when called from Visual Studio 2013, but not SQL Server Management Studio

三世轮回 提交于 2019-11-29 07:40:38
问题 Per MSDN Docs: http://msdn.microsoft.com/en-us/library/hh510202.aspx LocalDB supports two kinds of instances: Automatic instances and Named instances. I suspect this has something to do with my problem, so I am wondering if anyone knows how something like this gets automatically created. If I can quote from the docs, "One automatic instance of LocalDB exists for every version of LocalDB installed on the user’s computer." Here is a copy of the relevant section in the above link: Automatic

How can I specify that my app should start SQL Server LocalDb with a trace flag parameter?

霸气de小男生 提交于 2019-11-29 04:35:40
My application uses a LocalDb instance to store it's data. I've noticed a quirk in the way that LocalDb has allocated identifies (explained more here ) which I'd like to avoid. The linked answer explains that this can be done by setting an SQL Server trace flag, and explains how to do this for "full fat" SQL Server. Is it possible to set a trace flag on LocalDb? As my application starts it on demand, could this be done through the connection string? Richard Moore I have a similar problem and believe I have a workaround... Launch Regedit and find your localdb registry key. For me this was HKEY

How to define DataDirectory for ConnectionString in console application to work with EntityFramework Code First Migrations

末鹿安然 提交于 2019-11-29 03:05:24
问题 I try to set location MyProject\App_Data\Cos.mdf for the database in App.config : <connectionStrings> <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\Cos.mdf;Initial Catalog=Cos;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" /> </connectionStrings> In Program.cs I wrote: static void Main(string[] args) { string relative = @"..\..\App_Data\Cos.mdf"; string absolute = Path.GetFullPath

How to install LocalDB 2016 along with Visual Studio 2017?

半腔热情 提交于 2019-11-29 01:25:53
After installing Visual Studio 2017 with the SQL Server Data tools feature checked, I noticed LocalDB was not installed. How can I add SQL Server LocalDB 2016 to my Visual Studio 2017 installation? Did I miss a checkbox when installing VS2017, or is it simply not included with the installer? If so, how do I configure VS2017 so I can view and connect to my manually installed LocalDB database in Visual Studio's server browser? It's automatically installed if .NET Desktop Development is checked. You can check it in the Summary. SQL Server Express 2016 LocalDB is in .NET desktop development . If

Recreate and Reseed LocalDb Before Each Unit Test

这一生的挚爱 提交于 2019-11-28 20:45:50
I'm attempting to write unit/integration tests for my ASP.NET Web API project and struggling to run each test in isolation. Allow me to explain. I have a *.testsettings file with deployment settings configured. Before each test run, an empty *.mdf file is deployed to the test location. Since I'm using Entity Framework Code First, I can use a database initializer to push my schema to the database and seed a particular table with 2 rows. This works great. The problem I'm facing is that the various tests for all of my ApiControllers' actions can step on each other's toes if they execute in the

How to delete (localdb) database if the file is gone

南笙酒味 提交于 2019-11-28 19:09:17
If I run SQL Server Management Studio, and tell it to connect to (localdb)\v11.0, it knows about every database I've ever used, despite the fact that most of the the database files are long gone. If I ask it to delete one of these databases, it complains that it can't DROP the database because the database file is gone (duhhh). So, how do I clean up this mess and delete all of database references whose assicated database files are gone? Bob In this situation, detach the database rather than trying to drop it. In SQL Management Studio, right-click on the database, select "Tasks" then "Detach".

Is it normal to use LocalDb in production?

这一生的挚爱 提交于 2019-11-28 18:39:30
I know that using LocalDb is very good and easy for developement, I wonder if it's good idea to use it in production when I host websites on IIS server? I'm asking because I wonder if it won't have any kind of speed issues in production. This is my connection string that I want to use in production Server=(LocalDB)\\v11.0;Integrated Security=SSPI;MultipleActiveResultSets=true; AttachDBFilename=|DataDirectory|ProjectDB.mdf; LocalDB is absolutely supported in production. From the performance point of view it is identical to SQL Server Express, as they share the same database engine. Now, for a