sql-server-ce

How do I select the first row per group in an SQL Query?

ぐ巨炮叔叔 提交于 2019-11-30 05:14:51
I've got this SQL query: SELECT Foo, Bar, SUM(Values) AS Sum FROM SomeTable GROUP BY Foo, Bar ORDER BY Foo DESC, Sum DESC This results in an output similar to this: 47 1 100 47 0 10 47 2 10 46 0 100 46 1 10 46 2 10 44 0 2 I'd like to have only the first row per Foo and ignore the rest. 47 1 100 46 0 100 44 0 2 How do I do that? declare @sometable table ( foo int, bar int, value int ) insert into @sometable values (47, 1, 100) insert into @sometable values (47, 0, 10) insert into @sometable values (47, 2, 10) insert into @sometable values (46, 0, 100) insert into @sometable values (46, 1, 10)

Adding SQL Server Compact Edition data source to Visual Studio?

一个人想着一个人 提交于 2019-11-30 04:58:03
问题 I want to add a SQL Server Compact edition in my project in Visual Studio 2013.4, but I don't have the data source in my list: Also, I don't have System.Data.Sqlce in my assemblies. How can I add SQL Server Compact data source to my Visual Studio? 回答1: 1: Install the relevant runtime MSI (3.5 SP2 or 4.0) http://www.microsoft.com/en-us/download/details.aspx?id=5783 http://www.microsoft.com/en-us/download/details.aspx?id=30709 2: Install the SQL Server Compact Toolbox VS Extension, and browse

I don't have SqlServerCe assembly?

青春壹個敷衍的年華 提交于 2019-11-30 04:49:39
问题 I'm working on a simple WinForms app that uses an .sdf database to store data. I saw this interesting post on how to handle multithreaded access, which seemed useful. Problem is, I can't find the System.Data.SqlServerCe assembly. I installed the Sql Server Compact 3.5 SDK, but that reference still doesn't show up in my .NET assemblies list when I go to add the reference. What am I missing? I'm using Visual Studio 2010 Ultimate on Windows 7. 回答1: Go to "Tools" and select "Choose Toolbox Items.

Reverse boolean (bit) value in SQL CE select statement

别来无恙 提交于 2019-11-30 04:41:25
问题 I am trying to write a query that gets table information from a SQL CE database, ready to be put in c#, later to be exported to XML. I need one of the columns to be named 'IDENT' with a boolean value (to represent whether or not it is the identity column, obviously). For this, I am checking if the AUTOINC_SEED column is null, as follows: select isnull(AUTOINC_SEED) as IDENT from information_schema.columns However, this returns TRUE for non-identity columns and FALSE for identity columns! Is

How to deploy SQL CE 4 CTP to shared hosting?

半世苍凉 提交于 2019-11-30 03:18:35
问题 How do I deploy SQL CE 4.0 with EF4 to a shared hosting provider for ASP.NET MVC 2.0? I've included System.Data.SqlServerCe.dll, and the amd64 + x86 directories in my bin folder, but keep getting a ".net provider not found". I realize it's currently in CTP, but this is just for testing purposes. My project + host is configured for .net 4.0 回答1: With Visual Studio 2010 there is now an easy way to deploy SQL CE 4 to a shared hosting environment through the use of "Deployable Dependencies". You

A duplicate value cannot be inserted into a unique index [closed]

霸气de小男生 提交于 2019-11-30 03:11:14
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . Self answering question for future reference: If you have a table where you deleted and re-added content, you can get this error while inserting new rows with an ID equal to existing IDs: Server Error in '/'

Create sql server compact file in appdata folder

主宰稳场 提交于 2019-11-30 03:03:20
问题 I am developing a simple piece of software which uses Entity Framework code first and sql server compact 4. At the moment this setup works. Entity framework creates the sql server compact file if it doesn't yet exists. The path to the database is defined from within a connectionstring which is stored inside the app.config file. It is build up like this: <connectionStrings> <add name="DataContext" connectionString="Data source=Database.sdf;" providerName="System.Data.SqlServerCe.4.0"/> <

Database functionality with WPF app: SQLite, SQL CE, other? [closed]

时光毁灭记忆、已成空白 提交于 2019-11-30 02:53:39
I want to extend a WPF application with database functionality. Which database engine would you suggest and why? SQLite, SQL CE, other? John Rennemeyer Depending on the applications use, I would recommend using SQL Lite because it doesn't require you to install any other software (SQL CE or Express, etc. usually would require a separate install). A list of the most important benefits for SQL Lite from the provider link at the bottom of this post: SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine. Features include: Zero

SQL Compact Edition 3.5 - Access to the database file is not allowed

末鹿安然 提交于 2019-11-30 00:50:23
问题 I developed an application (100% local, no access to servers) using SQL Server Compact 3.5, and it works fine on my computer. However, when I deployed it on another computer, it shows this error: Access to the database file is not allowed. [ File name = data\BDApepucCE.sdf ] I deployed on a Windows XP computer. It shows this error whenever I try to write on the database, however, it works when I read. I did a test on a Windows 7 computer, and it worked 100%, except when the file was accessed

NTEXT with more than 4000 characters in SQL Server CE in Windows Phone

删除回忆录丶 提交于 2019-11-29 23:23:03
问题 NTEXT with more than 4000 characters in SQL Server CE in windows phone I have a database in my windows phone app with a ntext field in one of the tables, I'm trying to write some content to this field, but I get an InvalidOperationException with the message: String truncation: max=4000, len=4621 I am trying to use ntext because I know that nvarchar doesn't accept more than 4000 chars. I've searched for a solution but I couldn't find any. The only solution I found I cannot use on windows phone