sql-server-ce

Visual Studio 2008 (C#) with SQL Compact Edition database error: 26

我的梦境 提交于 2020-01-04 04:09:06
问题 A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) I've created a SQL compact database, included it in my application, and can connect to the database fine from other database editors, but within my

Entity Framework 6 SetInitializer DbContext does not work for SQL Server Express and SQL Server Compact

天涯浪子 提交于 2020-01-04 03:20:12
问题 I've got a problem with creating a new database every time my application starts. I read this post Entity Framework Database.SetInitializer simply not working , but it didn't help. Here is my code: public DatabaseContext(DatabaseType type) : base("name=" + type) { Database.SetInitializer(new DropCreateDatabaseAlways<DatabaseContext>()); } and I'm calling Database.Initialize(true); doesn't matter if true or false, both doesn't work. Later in my application I also "work" with the database so

Hosting site Asp.net MVC and SQL Server Compact 4

為{幸葍}努か 提交于 2020-01-02 22:15:18
问题 In my ISP, they must hire service SQL Server to host a sql server compact framework? The fact that MVC requires the host to have some extra service? Or a simple hosting plan already supports asp.net MVC? 回答1: You can bin-deploy SQL CE 4. Just make sure you are using the RTM version because there was a problem with bin-deployment in betas. Also see Scott Gu's blog post about it. ASP.NET MVC 3 can also be bin-deployed if your hosting provider doesn't have the assemblies installed in the GAC.

SqlCe opens slow under a limited user account in Windows XP

蓝咒 提交于 2020-01-02 10:19:23
问题 I have a windows application built with .NET 4.0. It has a SqlCe database under its program files directory: C:\Program Files\Company Name\Application Name\Data\Data.sdf This application is installed with Inno Setup and the Data folder is given permission with this inno setup configuration: [Dirs] Name: {app}\Data; Permissions: users-modify However, even if I deploy this application without the installer (just zip up all the files from my development machine and unzip on the target machine's

EF Code first cascade delete on foreign key one-to-many

有些话、适合烂在心里 提交于 2020-01-02 01:43:05
问题 We are working in Entity framework Code first We have a class video class Video{ List<ImageInfo> Images{ get; set; } } our image infoclass contains a path to the image and some other info class ImageInfo{ String path; ... } we would like to have EF remove the imageinfos when removing the video so we changed the modelbuilder like follows: modelBuilder .Entity<Video>() .HasMany(v => v.Images) .WithRequired() .WillCascadeOnDelete(true); we don't want to add a link back to video in our imageinfo

How do I bind a WPF Image element to a PNG on the local hard drive using a relative filepath derived from a DB?

江枫思渺然 提交于 2020-01-01 12:07:45
问题 I've got a folder on the local hard drive with several images in it. The image names/paths are stored in a local SQLCE database. In a WPF application I'm trying to bind those images to an Image element (which eventually goes into a listbox). I've got the application to run and compile and the listbox shows up but there is no image where it is supposed to be. This is the XAML that defines the data template that the listbox uses... <Window.Resources> <DataTemplate x:Key="assetLBTemplate">

Sql Compact randomly produces AccessViolationException

一曲冷凌霜 提交于 2020-01-01 11:12:14
问题 I am running Sql Server Compact Edition 3.5.1.0 SP1 in a multi-thread application. The application randomly runs insert queries in transactions. With short transactions, it works fine. But when the transactions get longer and delay between executions get shorter or when I run the application in debug mode, SqlCE begins to throw the following exception randomly: AccessViolationException Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at

Sql Compact randomly produces AccessViolationException

允我心安 提交于 2020-01-01 11:10:10
问题 I am running Sql Server Compact Edition 3.5.1.0 SP1 in a multi-thread application. The application randomly runs insert queries in transactions. With short transactions, it works fine. But when the transactions get longer and delay between executions get shorter or when I run the application in debug mode, SqlCE begins to throw the following exception randomly: AccessViolationException Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at

Linq with optional Where clauses and Sql Server CE

时光总嘲笑我的痴心妄想 提交于 2020-01-01 10:48:15
问题 I have a search form with an optional User Name field. If the User Name is not supplied then all matches should be returned. I am using Linq and Sql Server CE 4.0. The linq code looks like the following -> from p in context.Accounts where (name==string.Empty || p.UserName.Contains(name)) With Sql Server CE this throws the following error "A parameter is not allowed in this location. Ensure that the '@' sign is in a valid location or that parameters are valid at all in this SQL statement." Is

Linq with optional Where clauses and Sql Server CE

二次信任 提交于 2020-01-01 10:48:06
问题 I have a search form with an optional User Name field. If the User Name is not supplied then all matches should be returned. I am using Linq and Sql Server CE 4.0. The linq code looks like the following -> from p in context.Accounts where (name==string.Empty || p.UserName.Contains(name)) With Sql Server CE this throws the following error "A parameter is not allowed in this location. Ensure that the '@' sign is in a valid location or that parameters are valid at all in this SQL statement." Is