localdb

ClickOnce Prerequisites: where is SQL Server Express 2014 LocalDB?

折月煮酒 提交于 2019-12-31 14:34:14
问题 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

How to protect SqlLocalDB database file with custom password

北慕城南 提交于 2019-12-29 09:59:42
问题 I have designed a software using SqlLocalDb v11.0 instance. The database will be on user's machine ( .mdf file). I was using SQL Server CE before. In SQL Server CE my database is protected by a password with "Encryption Mode = Engine Default" Is there any way to protect SqlLocalDB? I know there is a way using named instances, as in the link https://msdn.microsoft.com/en-us/library/hh510202(v=sql.110).aspx Is there any way to associate password with LocalDB .mdf file. So that any other can not

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

两盒软妹~` 提交于 2019-12-29 09:18:36
问题 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 回答1: LocalDb doesn't exist for Azure. LocalDb is a feature of SQL Server Express, there is no equivalency

LocalDb and SMO - how to choose where to put database files?

梦想与她 提交于 2019-12-25 05:59:14
问题 I've started to experiment with the SQL Server 2012 feature LocalDb. I'm doing some powershell scripting with SMO against the instances I create, such as creating databases. To do this, I have this function: Function New-Database { Param( $server, $databaseName ) $serverHandle = New-Object Microsoft.SqlServer.Management.Smo.Server($server) if($serverHandle.Databases.Name.Contains($databaseName)) { throw "Database $databaseName already exists" } $databaseHandle = New-Object Microsoft.SqlServer

LocalDb and SMO - how to choose where to put database files?

时光怂恿深爱的人放手 提交于 2019-12-25 05:58:30
问题 I've started to experiment with the SQL Server 2012 feature LocalDb. I'm doing some powershell scripting with SMO against the instances I create, such as creating databases. To do this, I have this function: Function New-Database { Param( $server, $databaseName ) $serverHandle = New-Object Microsoft.SqlServer.Management.Smo.Server($server) if($serverHandle.Databases.Name.Contains($databaseName)) { throw "Database $databaseName already exists" } $databaseHandle = New-Object Microsoft.SqlServer

How to take Back up of LocalDB C# my database file name is MyDatabase.mdf

蹲街弑〆低调 提交于 2019-12-25 05:21:58
问题 string dbpath= System.Windows.Forms.Application.StartupPath; string dbp = dbpath + "\\MyDatabase.Mdf"; SqlCommand cmd = new SqlCommand("backup database ['"+dbp+"'] to disk ='d:\\svBackUp1.bak' with init,stats=10",con); cmd.ExecuteNonQuery(); 回答1: Error was that "The identifier start with---- is too long. Maximum length is 128" so I Make the "MyDatabase.mdf" with small Name "MyDb.mdf".So the identifier becomes less than 128. My code is SqlConnection con = new SqlConnection(ConfigurationManager

Localdb connection from c# .net 3.5

蓝咒 提交于 2019-12-25 03:58:16
问题 We created a windows application in .net 3.5. When i run it on my development machine (installed application, not from VS) i can connect to a local db database server using the servername: (localdb)\v11.0 . When starting on the client's computer i get an exception when using this servername. When i use the named-pipe servername i can connect and query the databases. On my development machine i can also connect to (localdb)\v11.0 from SSMS (Express) 2008 R2 SP2. This also does not work on the

Trouble connecting to localdb via SQLCMD in PowerShell - what is server instance name?

百般思念 提交于 2019-12-25 03:34:52
问题 SQL Server newbie here - I'm trying to access the localdb\MSSQLLocalDB server on my computer through PowerShell with the SQLCMD utility. I'm using PowerShell v5, .NET v5.0, and The server name is (localdb)\MSSQLLocalDB when I connect to it in Microsoft SQL Server Management Studio 2014. PS C:\> sqlcmd -S localdb\MSSQLLocalDB and PS C:\> sqlcmd -S .\localdb\MSSQLLocalDB result in this error: Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : SQL Server Network Interfaces: Error Locating

db.mdf is being used by another process

≡放荡痞女 提交于 2019-12-25 01:54:24
问题 Right now by code looks like the following: private void DatabaseIntegrityCheck() { try { string m_checksum; using (FileStream stream = File.OpenRead(@"C:\~\db.mdf")) { SHA256Managed sha = new SHA256Managed(); byte[] checksum = sha.ComputeHash(stream); m_checksum = BitConverter.ToString(checksum).Replace("-", String.Empty); } Console.WriteLine(m_checksum); } catch (Exception ex) { Console.WriteLine("unable to retrieve checksum"); } } When I set a breakpoint in my code to see what the

Algorithm to calculate the nearest location (from the database) based on logitude & latitude

拜拜、爱过 提交于 2019-12-24 20:48:54
问题 What i want to do is develop an algorithm to calculate which known locations are closest to the selected location. Let's say i have 7 locations in the database and when the user selects one, he should have the option to see the, let's say, first 3 closest locations (from the database). In the database, each location is saved with latitude and longitude. Any idea on how i can do that? Example: Say the list contains 100 locations of bike stations. I am at station 5, and I want to find out what