sql-server-ce-4

Should I use Lucene.Net for full text search with SQL Compact Edition 4, or is there a better option?

女生的网名这么多〃 提交于 2019-12-07 07:47:46
问题 I'm trying to create a full text search facility for a small blog which is running against a SQL Compact Edition 4 database. There seems to be almost no information out there about this (though I'd be happy if someone can prove me wrong), but as far as I can gather, SQL CE doesn't support the normal SQL Server full-text indexing. I have briefly looked into using Lucene.Net, but it seems quite complex at first glance; would this be my best option here, or is there a simpler solution which I'm

SQL: Return only first occurrence

十年热恋 提交于 2019-12-06 22:16:34
问题 I seldomly use SQL and I cannot find anything similar in my archive so I'm asking this simple query question: I need a query which one returns personID and only the first seenTime Records: seenID | personID | seenTime 108 3 13:34 109 2 13:56 110 3 14:22 111 3 14:31 112 4 15:04 113 2 15:52 Wanted result: personID | seenTime 3 13:34 2 13:56 4 15:04 That's what I did & failed: SELECT t.attendanceID, t.seenPersonID, t.seenTime (SELECT ROW_NUMBER() OVER (PARTITION BY seenID ORDER BY seenID) AS

Entity Framework 6 Update Graph

若如初见. 提交于 2019-12-06 19:04:40
问题 What is the correct way to save a graph of objects whose state you don't know? By state I mean whether they are new or existing database entries that are being updated. For instance, if I have: public class Person { public int Id { get; set; } public int Name { get; set; } public virtual ICollection<Automobile> Automobiles { get; set; } } public class Automobile { public int Id { get; set; } public int Name { get; set; } public short Seats { get; set; } public virtual ICollection

How to detect if SQL Server CE 4.0 is installed

蓝咒 提交于 2019-12-06 05:48:55
问题 I develop some application that needs SQL Server CE 4.0 installed. I do all job under Windows 7 64-bit so I have installed SQL Server CE 4.0 64-bit. How I can do some checking if there is installed SQL Server CE 4.0 32-bit/64-bit when I start the application/or installer? Which is the approach in general? Any clue, articles and etc? Thanks!! P.S. I read this link How can InstallShield check if SQL Server 2005 (3.1) Compact Edition (CE) is installed but it doesn't help. 回答1: Just include all

SQL Server Compact Edition 4 - AccessViolationException

China☆狼群 提交于 2019-12-05 09:37:21
I'm building a .NET 4 WPF application using Entity Framework code first and SQL Server Compact 4.0. I'm trying to call DbContext.SaveChanges() on a background thread to avoid blocking the UI, but I'm occasionally getting the following exception: System.AccessViolationException occurred Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Source=System.Data.SqlServerCe StackTrace: at System.Data.SqlServerCe.NativeMethodsHelper.OpenStore(IntPtr pOpenInfo, IntPtr pfnOnFlushFailure, IntPtr& pStoreService, IntPtr& pStoreServer, IntPtr&

SQL: Return only first occurrence

半腔热情 提交于 2019-12-05 03:14:14
I seldomly use SQL and I cannot find anything similar in my archive so I'm asking this simple query question: I need a query which one returns personID and only the first seenTime Records: seenID | personID | seenTime 108 3 13:34 109 2 13:56 110 3 14:22 111 3 14:31 112 4 15:04 113 2 15:52 Wanted result: personID | seenTime 3 13:34 2 13:56 4 15:04 That's what I did & failed: SELECT t.attendanceID, t.seenPersonID, t.seenTime (SELECT ROW_NUMBER() OVER (PARTITION BY seenID ORDER BY seenID) AS RowNo, seenID, seenPersonID, seenTime FROM personAttendances) t WHERE t.RowNo=1 P.S: Notice SQL CE 4 If

Entity Framework 6 Update Graph

我怕爱的太早我们不能终老 提交于 2019-12-05 00:33:00
What is the correct way to save a graph of objects whose state you don't know? By state I mean whether they are new or existing database entries that are being updated. For instance, if I have: public class Person { public int Id { get; set; } public int Name { get; set; } public virtual ICollection<Automobile> Automobiles { get; set; } } public class Automobile { public int Id { get; set; } public int Name { get; set; } public short Seats { get; set; } public virtual ICollection<MaintenanceRecord> MaintenanceRecords { get; set ;} public virtual Person Person { get; set; } } public class

How to detect if SQL Server CE 4.0 is installed

一世执手 提交于 2019-12-04 09:10:49
I develop some application that needs SQL Server CE 4.0 installed. I do all job under Windows 7 64-bit so I have installed SQL Server CE 4.0 64-bit. How I can do some checking if there is installed SQL Server CE 4.0 32-bit/64-bit when I start the application/or installer? Which is the approach in general? Any clue, articles and etc? Thanks!! P.S. I read this link How can InstallShield check if SQL Server 2005 (3.1) Compact Edition (CE) is installed but it doesn't help. Just include all the required files with your app, and it will run on both x86 and x64 - see my blog post here: http://erikej

Very poor performance for batch insert with SQL Server CE 4.0 and Entity Framework 4.2

☆樱花仙子☆ 提交于 2019-12-04 03:21:24
I'm inserting a lot of data into SQL Server CE 4.0 using Entity Framework 4.2 (code-first), and the performance is abysmal when compared to direct SQL insertion. The model is very simple: public class DocMember { public DocMember() { this.Items = new List<DocItem>(); } public int Id { get; set; } public string Name { get; set; } public string MemberType { get; set; } public string AssemblyName { get; set; } public virtual IList<DocItem> Items { get; set; } } public class DocItem { public int Id { get; set; } public DocMember Member { get; set; } public string PartType { get; set; } public

ASP.NET MVC 3 app, BCrypt.CheckPassword failing

天大地大妈咪最大 提交于 2019-12-04 01:36:35
问题 I'm working on implementing security in an ASP.NET MVC 3 application, and am using the BCrypt implementation found here to handle encryption and verification of passwords. The user registration screen encrypts the password the user provides just fine, and the hashed password gets saved to the database. I'm having a problem with password verification on the login page though, and I can't seem to figure out why. My registration controller action contains the following: [HttpPost] [RequireHttps]