sql-server-ce

Microsoft Sync Framework, Microsoft Entity Framework 4.1 & SQL CE 4.0

青春壹個敷衍的年華 提交于 2019-12-11 10:29:09
问题 We are developing an occasionally connected application that uses SQL Compact on the client machines and SQL Server 2008 (with change tracking) on the server. The application is being developed using Entity Framework’s code first model, which requires that the local SQL Compact database be 4.0. We would like to use Microsoft Sync Framework to handle synchronizing data from the central server to the occasionally connected clients but recently discovered that while SQL Compact 3.5 SP2 is

Downgrade SQL CE from 4 to 3.5?

喜你入骨 提交于 2019-12-11 10:24:44
问题 Does anyone know if it's possible to downgrade an existing SQL CE 4 database to 3.5? The reason I ask is because I'm looking to migrate from SQL CE to VistaDB...and VistaDB's data migration wizard only takes SQL CE 3.5 db's. 回答1: Yes, you can use my scripting tools to export the 4.0 file to a sql script, and create the 3.5 file from the script, as I describe here: http://erikej.blogspot.com/2010/02/how-to-use-exportsqlce-to-migrate-from.html 回答2: I actually just found an answer to my own

Permission denied for SQL Server CE on Win XP

天大地大妈咪最大 提交于 2019-12-11 09:18:36
问题 I am getting a "Permission denied" exception when I connect to a .sdf file. I am using this connection string. connection string="Data Source=|DataDirectory|\DB.sdf;Password='something';Mode = Read Only;Temp Path= Environment.GetFolderPath(Environment.SpecialFolder.Templates);Persist Security Info=True"" providerName="System.Data.EntityClient" /> This is work fine on Win 7 but when I run my app on Win XP it returns Permission denied exception I tried different address for temp file but it

EF, How to save/retrieve TimeSpan as other data type?

折月煮酒 提交于 2019-12-11 08:35:49
问题 SQLCe doesn't support TimeSpan, so I need to save this in some other way. Is it possible to define somewhere a default conversion, like in the DbContext, or would I need to handle this manually in the repositories? I don't like to change my entity classes just because of this. Btw, I only save TimeSpan of < 24h. Example would be great if there are some neat tricks. 回答1: I know you say you don't want to modify your entities, but if you're using code first this would be pretty simple to do by

How to automatically upgrade deployed database for end-users

☆樱花仙子☆ 提交于 2019-12-11 07:55:05
问题 I've read a fair number of questions on how to upgrade a database for developer and such, and I'm leaning towards using migratordotnet or something similar, however it seems the the upgrades need to be run with something like MSBuild or NAnt. These are not things I should expect an end-user to have installed. Ideally the process should be the user installs the new version of the app, launches it and it takes care of everything behind the scene. Depending on how long the process takes I may or

Uniqueidentifier as Identity in SQL Server CE?

半城伤御伤魂 提交于 2019-12-11 07:54:43
问题 In SQL Server CE can I create an identity column with data type uniqueidentifier ? If so, how? If not, why not? I have tried creating it with "New Table"from the Server Explorer in VS2010, and the Identity option only gets enabled when the type is int. Edit: According to EricEJ's suggestion I did make the column PK. I also set it to be a "RowGuid" CREATE TABLE [MyTable] ( [Id] uniqueidentifier ROWGUIDCOL ... I don't know exactly the intended purpose of the RowGuid property, but it seem to

Attendance record from bio-metric device

江枫思渺然 提交于 2019-12-11 07:34:20
问题 Here is my data |Id |EmpCode |CheckInCheckOutDate |WorkDate |InOutMode |247 |51 |2017-02-13 20:08:52.000 |2017-02-13 20:08:52.000 |0 |392 |51 |2017-02-13 22:38:51.000 |2017-02-13 22:38:51.000 |1 |405 |51 |2017-02-13 22:59:18.000 |2017-02-13 22:59:18.000 |0 |415 |51 |2017-02-13 23:18:17.000 |2017-02-13 23:18:17.000 |1 |423 |51 |2017-02-13 23:33:44.000 |2017-02-13 23:33:44.000 |0 |456 |51 |2017-02-14 01:30:15.000 |2017-02-13 01:30:15.000 |1 |463 |51 |2017-02-14 02:52:02.000 |2017-02-13 02:52:02

Problem using SQL Server CE with Entity Framework code-first and ASP.NET MVC 3 and mvc miniprofiler

末鹿安然 提交于 2019-12-11 07:27:31
问题 I am attempting to create an ASP.NET MVC 3 application using C#, Entity Framework 4.0 code-first and SQL Server CE, and the automated scaffolding. Everything works fine until I try to actually use a page that connects to the SQL Server CE database. My connection in the web.config is this <add name="BRX" connectionString="Data Source=|DataDirectory|BRX.sdf" providerName="System.Data.SqlServerCe.4.0"/> My model class looks like this using System; using System.Collections.Generic; using System

Why is SQL CE Toolbox failing to parse my csv file?

匆匆过客 提交于 2019-12-11 07:18:55
问题 SQLCEToolbox looks very promising. I installed it, opened VS 2012, selected Tools | SQL Server Compact Toolbox, quickly and easily set up a connection to my sdf database, which I had (also quickly and easily) created in WebMatrix. I then right-clicked the database in SQLCEToolbox's treeview and selected Import from CSV file. Note: One must explicitly specify the column names on the first line in the file (line/row 0) and explicitly add the ID/Primary Key/Identity vals (if you have such a

Setup project, SQL compact 4 prerequisites

一个人想着一个人 提交于 2019-12-11 06:43:30
问题 I have created a setup project in my application in order to include SQL compact 4 in the installation, as a prerequisite downloadable at the vendor's site (microsoft). I did everything thourg Visual Studio 2010 console (with SP1). Now, when I try to install the package, the setup doesn't realize that SQL compact is installed. Why? I don't want to use any other form of private deployment like copying the dlls and including them into my project. Thanks! 回答1: Most likely the prerequisite is not