sql-server-ce

How can I manage SQL CE databases in SQL Server Management Studio?

冷暖自知 提交于 2019-11-27 14:36:16
I created a SDF (SQL CE) database with Visual Studio 2008 (Add / New Item / Local Database). Is it possible to edit this database with SQL Server Management Studio? I tried to attach it but it only offered .mdf and attaching a .sdf file results in "failed to retrieve data for this request". If so, is it possible to create SDF files with Management Studio as well? Or are we stuck with the simple interface of the Visual Studio 2008 database manager? You can create .sdf files with SQL Server 2008 Management Studio. In the File > Connect Object Explorer dialog, change the Server Type dropdown to

What is the best way to represent a timespan in SQL Server CE?

北慕城南 提交于 2019-11-27 14:27:06
问题 Specifically speaking I only need hours:minutes but say I have a .NET TimeSpan object, how should I store that in a SQL(CE) database? 回答1: I'd recommend using a long to represent the number of ticks. That's what TimeSpan uses as it's internal representation. This lets you easily reconstitute your object with the Timespan.FromTicks() method, and output to the database using the Timespan.Ticks property. The smallest unit of time in .NET is the tick, which is equal to 100 nanoseconds 回答2: Store

An overflow occurred while converting to datetime using EF4

不羁的心 提交于 2019-11-27 13:37:09
问题 I have a windows application working with a SQL Compact 4.0 database, using EF 4.1 and code-first approach. I cannot save an object to the database since I'm getting an exception, with inner exception "An overflow occurred while converting to datetime" when trying to save the type Quotation: public class Quotation { public int ID { get; set; } public string Name { get; set; } public DateTime DateCreated { get; set; } public ContactPerson ContactPersonAssigned { get; set; } public string

resolving corruption in SQL Server Compact Edition database files

a 夏天 提交于 2019-11-27 13:12:10
This is not a query. Its a summary of our solution to get around the problem of corruption in SQL Compact Database files with (almost) definite success. SQLCE Corruption is a very common problem. We've received tremendous help from earlier posts in StackOverflow, and hence this post. Our product is a 3-tier architecture with the server running as a Windows Service connected to Rich Clients through .Net Remoting. Our product uses SQLCE since 2006. We have moved from v3.1, to v3.5 and now v4.0. We've a custom OR-Mapping tool for some very specific requirements. We've faced limited problems with

What are the limitations to SQL Server Compact? (Or - how does one choose a database to use on MS platforms?)

妖精的绣舞 提交于 2019-11-27 11:32:32
The application I want to build using MS Visual C# Express (I'm willing to upgrade to Standard if that becomes required) that needs a database. I was all psyched about the SQL Server Compact - because I don't want the folks who would be installing my application on their computers to have to install the whole of SQL Server or something like that. I want this to be as easy as possible for the end user to install. So I was all psyched until it seems that there are limitations to what I can do with the columns in my tables. I created a new database, created a table and when I went to create

How do you open an SDF file (SQL Server Compact Edition)? [closed]

这一生的挚爱 提交于 2019-11-27 10:42:18
I have an SDF file and I would like to retrieve its schema and query it with some UI. How can I do this? I have no Visual Studio installed on the machine and I would like to install as little software as possible. Peter Schuetze Try the sql server management studio (version 2008 or earlier) from Microsoft. Download it from here . Not sure about the license, but it seems to be free if you download the EXPRESS EDITION. You might also be able to use later editions of SSMS. For 2016, you will need to install an extension. If you have the option you can copy the sdf file to a different machine

Entity Framework 4 and SQL Compact 4: How to generate database?

本小妞迷上赌 提交于 2019-11-27 09:32:47
问题 I am developing an app with Entity Framework 4 and SQL Compact 4, using a Model First approach. I have created my EDM, and now I want to generate a SQL Compact 4.0 database to act as a data store for the model. I bring up the Generate Database Wizard and click the New Connection button to create a connection for the generated file. The Choose Data Source dialog appears, but SQL Compact 4.0 is not listed in the list of available data sources: I am running VS 2010 SP1 (beta) and I have

Cannot find namespace 'System.Data.SqlServerCe'

∥☆過路亽.° 提交于 2019-11-27 08:52:33
I did include the System.Data.SqlServerCe dll, put using System.Data.SqlServerCe; in my code, but when I open the .NET page I get: The type or namespace name 'SqlServerCe' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) I have nave no idea how to fix this. Thanks in advance. This can be solved confirming following 2 points: Check whether you already have System.Data.SqlServerCe namespace added to the References folder of your application. If its not there you may right click the References folder and select Add references option. From the popup window go

Blocking behaviour with Entity Framework Async methods and SQL Server Compact

帅比萌擦擦* 提交于 2019-11-27 08:34:13
问题 I have an MVVM app that calls a data service to get some data to bind. The data service accesses a SQL Server Compact (v4.0) database through Entity Framework 6. The data (currently) takes a few seconds to be loaded and when called synchronously this (not surprisingly) blocks the GUI thread. Most of this I had assumed to be IO bound so I added an equivalent Async method to execute the data load in an asynchronous fashion to allow the GUI to remain responsive. However when I make use of the EF

Why can't I insert a record into my SQL Compact 3.5 database?

泪湿孤枕 提交于 2019-11-27 08:03:49
问题 I just made a very simple test app using documentation from MSDN. All I want to do is insert a record into my table which is in a SQL Server Compact database in my VS 2010 app. But when I run it, it acts like it executes fine (no errors), but a record is never inserted into my SQL Compact 3.5 database when I go to view the table data from Server Explorer. My code is as follows: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.SqlServerCe;