localdb

I can't get a Sql Server localdb connection to work on a computer that does not have SqlServer Express installed

我的梦境 提交于 2019-12-04 08:55:20
问题 I have a C# console application written using Visual Studio 2012. In the application I am using a Sql Server localdb connection to a database to store information. This is working fine on several computers, all of which have Visual Studio installed. I would like to deploy a program that only has to install the Sql Server Express LocalDB, and not the larger Sql Server Express. However, my application is not running on the target computers. I have installed Sql Server Express LocalDB 2014 on a

Cannot connect to (LocalDB)\MSSQLLocalDB -> Login failed for user 'User-PC\User'

半城伤御伤魂 提交于 2019-12-04 07:41:55
问题 I am getting an error, While I am trying to connect (LocalDB)\MSSQLLocalDB through SQL Server management studio. I also tried to login with default database as master the error is same. Here is the Server details. 回答1: The following command through sqllocaldb utility works for me. sqllocaldb stop mssqllocaldb sqllocaldb delete mssqllocaldb sqllocaldb start "MSSQLLocalDB" After that I restarted the sql server management studio, and it is successfully established connection through (LocalDB)

How to connect to SQL Server LocalDB using Invoke-Sqlcmd?

扶醉桌前 提交于 2019-12-04 02:58:24
I have sqlcmd.exe from both SQLServer 2008 and SQLServer 2012: PS C:\> Get-Command sqlcmd.exe Definition ---------- C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SQLCMD.EXE By modifying $env:PATH i force the use of sqlcmd.exe from SQL Server 2012: PS C:\> $env:PATH = ($env:PATH -split ";" | Where-Object { $_ -notlike "*\Microsoft SQL Server\100\*" }) -join ";" PS C:\> Get-Command sqlcmd.exe Definition ---------- C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SQLCMD.EXE The default instance of LocalDB is up and running

Change default location of LocalDb

两盒软妹~` 提交于 2019-12-04 00:23:52
I am programming with EF5-code first and want to use LocalDb. How can I change the default location of LocalDb database file? Default location is %USERPROFILE% directory according to http://blogs.msdn.com/b/sqlexpress/archive/2011/10/28/localdb-where-is-my-database.aspx Previously I was using SqlCe DbConnectionFactory which accepts a parameter for database path/name. If I use AttachDbFileName parameter then it raises an exception if database doesn't exist (it's supposed to create it!). Hoss I got this working thanks to this post . The answer is simple. Basically I added <connectionStrings>

Does SQL Profiler work with LocalDB?

五迷三道 提交于 2019-12-03 14:57:14
Is it possible to use SQL Profiler to observe queries being requested of a LocalDB instance? You can use SQL Profiler just as you do with all other SQL editions as long as you know the proper server name. You can find the server name using the SqlLocalDb utility. To find it, use sqllocaldb info YourInstanceName to find the Instance Pipe Name . It has the form np:\\.\pipe\LOCALDB#12345\tsql\query Use this as the server name to connect to the server and start profiling This is what I used on SQL Server Express 2012 (note: not "LocalDB* - I have never used LocalDB so maybe that is different to a

How to work with LocalDB and EF, without using migrations

牧云@^-^@ 提交于 2019-12-03 07:29:57
I am on VS 2012 RTM, with EF 5. I am doing Code First, but trying to ignore Code Migrations since I am just in development. To avoid them, I have this set Database.SetInitializer(new DropCreateDatabaseIfModelChanges<SomeContext>()); Occasionally, even when I don't think I've touched the model, it decides to recreate. That's fine. But it usually results in the error Cannot drop database because it is currently in use. So I decided to delete the database entirely. I go into VS, go to the "SQL Server Object Explorer", find the DB and delete it. Now I'm stuck at Cannot attach the file '{0}' as

How do I copy SQL Server 2012 database to localdb instance?

谁说胖子不能爱 提交于 2019-12-03 06:46:04
问题 I'm looking to copy a SQL Server 2012 Standard database to my localdb instance. I've tried the wizard which complains that localdb isn't a SQL Server 2005 or later express instance . I also did a backup/restore but upon the restore in my localdb I get the following error... Running this... RESTORE DATABASE CSODev FROM DISK = 'C:\MyBckDir\CSODev.bak' WITH MOVE 'CSOdev_Data' TO 'C:\Users\cblair\CSOdev_Data.mdf', MOVE 'CSOdev_Log' TO 'C:\Users\cblair\CSOdev_Log.ldf', REPLACE Error message I get.

I can't get a Sql Server localdb connection to work on a computer that does not have SqlServer Express installed

风格不统一 提交于 2019-12-03 02:22:26
I have a C# console application written using Visual Studio 2012. In the application I am using a Sql Server localdb connection to a database to store information. This is working fine on several computers, all of which have Visual Studio installed. I would like to deploy a program that only has to install the Sql Server Express LocalDB, and not the larger Sql Server Express. However, my application is not running on the target computers. I have installed Sql Server Express LocalDB 2014 on a target computer. I can, using a command line, run commands using sqllocaldb to verify that it is

ClickOnce Prerequisites: where is SQL Server Express 2014 LocalDB?

随声附和 提交于 2019-12-02 22:53:47
I am creating a clickonce installer for my wpf application from within Visual Studio 2013 Community edition. This application uses a localdb. It works fine on the target machines if I manually install sqlserver express 2014 LocalDB. But I would like to include the installer for SQL Server Express 2014 LocalDB with my clickonce deployment. When I open the prerequisites dialog, however, only SQL Server 2012 Express LocalDB is available (see image). I tried selecting '2012, but it is not compatible with the mdf file my installer drops into the data folder. The question is: How do I include the

How do I copy SQL Server 2012 database to localdb instance?

▼魔方 西西 提交于 2019-12-02 21:17:19
I'm looking to copy a SQL Server 2012 Standard database to my localdb instance. I've tried the wizard which complains that localdb isn't a SQL Server 2005 or later express instance . I also did a backup/restore but upon the restore in my localdb I get the following error... Running this... RESTORE DATABASE CSODev FROM DISK = 'C:\MyBckDir\CSODev.bak' WITH MOVE 'CSOdev_Data' TO 'C:\Users\cblair\CSOdev_Data.mdf', MOVE 'CSOdev_Log' TO 'C:\Users\cblair\CSOdev_Log.ldf', REPLACE Error message I get... Processed 8752 pages for database 'CSODev', file 'CSOdev_Data' on file 1. Processed 5 pages for