sql-server-ce

LINQ aggregate left join on SQL CE

What I need is such a simple, easy query, it blows me away how much work I've done just trying to do it in LINQ. In T-SQL, it would be: SELECT I.InvoiceID, I.CustomerID, I.Amount AS AmountInvoiced, I.Date AS InvoiceDate, ISNULL(SUM(P.Amount), 0) AS AmountPaid, I.Amount - ISNULL(SUM(P.Amount), 0) AS AmountDue FROM Invoices...

SSIS 2008 - How to read from SQL Server Compact Edition file?

I can see "SQL Server Compact Destination" under Data Flow Destinations, but I am looking for its source counterpart. If I choose ADO.Net source and create a new connection, there's no provider for SQL CE. What am I missing? Thanks! Update: I am able to create a "Data Source" (under "Data Sources" folder in my SSIS project") that con...

How to do Sql Server CE table update from another table

I have this sql: UPDATE JOBMAKE SET WIP_STATUS='10sched1' WHERE JBT_TYPE IN (SELECT JBT_TYPE FROM JOBVISIT WHERE JVST_ID = 21) AND JOB_NUMBER IN (SELECT JOB_NUMBER FROM JOBVISIT WHERE JVST_ID = 21) It works until I turn it into a parameterised query: UPDATE JOBMAKE SET WIP_STATUS='10sched1' WHERE JBT_TYPE IN (SELECT JBT_TYPE FROM JOB...

NHibernate + SqlCE - Forever Lazy?

I'm working on a Winforms app with NHibernate as my ORM layer. Everything is going well, but it doesn't seem that NHibernate is respecting my instructions to not use lazy loading. Problem 1: The app is a task list type of thing, and tasks can have child tasks. I'm representing these in a TreeView, so I need to first add nodes for top-l...

Deployment of SQL compact Edition (SDF files) using Setup project

Hi, I have a C#.NET desktop application using SQL Compact edition as data store. The application should be used by any user on the machine and all should be seeing the same data ( data should not different per user). I am wondering where should I deploy the SDF file? User's Personal data folder (My Documents) means each user will have...

SQL Server CE + Addin Read and Write Collision Avoidance?

We have an Office Addin that uses Sql CE with the usual DBConnection to a *.sdf in the filesystem ('C:/...etc...'). When we start two copies of the application having the Sql CE-augmented Office Addin (testing what a user might do by mistake) the Sql CE database becomes corrupted and the Office Addin can no longer access its data. It...

Why are my LINQ INSERTS not persisting in SQL Server CE 3.5?

I am using LINQ to SQL with Sql Server Compact Edition 3.5 and VS2008. I have a very simple table (Tokens) with a uniqueidentifier primary key (TokenID) and two other nullable fields (UsedBy and UsedOn). I am trying to use LINQ to insert new rows into the table but for some reason they are not persisting. Here is my code: var ...

How to use a "sql compact " database from non .NET language?

How to use sql compact database from a non .NET program? For example I want to access from VB6 I want to use a database populated by C# in sql compact. I don't access c# program source to change it's database ...

Using Subsonic 2.2 on Windows Mobile 5 with SQL Server CE 3.5

I have seen comments stating that Subsonic currently does nt support MS SQL Server CE (http://stackoverflow.com/questions/1130863/subsonic-and-ms-sql-server-compact-data-provider). The link provided is for Subsonic 3. So my question is, does Subsonic 2.2 support MS SQL Server CE? And if so, is there any documentation on how to use sonic...

Sql Compact and __sysobjects

I have some SQL Compact queries that create tables inside of transaction. This is mainly because I need to simulate temporary tables, which SQL Compact does not support. I do this by creating a real table, and then dropping it at the end of the transaction. This mostly works. Sometimes, however, when creating the tables Sql Compact will...

KeyNotFoundException: SQLCE Database Exception

I am using a dataSet in C#. I have done a direct count for the number of items in the SQL CE database, so I know how many items that I have in the database. There are no deletions in the the database. I get the following unexplained exception(s) : A first chance exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in Sys...

Maximum size for a SQL Comapct Framework: Wrap round database

Does anyone know how to define the maximum size for a SQL database in C#. Also, once the maximum size is reached how do you wrap round to restart from the oldest record to add in the new data rows? Examples would be great :-) ...

Conditional insert in SqlServer Compact Edition

Is there a way to do a conditional insert in the compact edition? I've tried two ways that I think would work on SqlServer: INSERT INTO CUSTQUOTE (QTE_ID) VALUES (1) WHERE EXISTS(SELECT * FROM JOB WHERE JOB_NUMBER = 'EW090800345') There was an error parsing the query. [ Token line number = 2,Token line offset = 1,Token in error = WHERE...

SqlCeDataAdapter.Fill method causes application to exit silently

I have a call to SqlCeDataAdapater. Fill with a DataSet that kills my app with no exception. It only seems to happen when I attempt to load in a large number of records (approx 30,000 rows). I get nothing in the debugger the app just dies with no exceptions. I've checked the mem usage and there is more than enough memory available to...

SQL Server Compact timed out waiting for a lock

Hi all, I'm having an application in that i use Sql Compact 3.5 with VS2008. I'm running multiple threads in my application which contacts the compact database and accesses the row. It selects and deletes those rows in a fashion i.e selecting and giving to the application 5 rows and deleting those rows from the table. It works great with...

.Net Source Debugging on Windows 7

We are trying to debug through a Sql Server CE issue on a Windows 7 Enterprise RTM (64-bit) desktop running the .Net Framework 3.5, SP1. The application is crashing consistently and we are trying to set up .Net Framework debugging for Visual Studio 2008, SP1. Using the scattered resoures around the internet, we set the options: Symbol...

NHibernate: Could not create the driver from Test.SqlServerCeDriver_ImageFix.

Im trying to resolve an issue where when using NHibernate with a SqlServerCeDriver that uses an image column you receive an error: "Byte array truncation to a length of 8000.". I found the following solution: http://mgeorge-notes.blogspot.com/2009/05/nhibernate-mapping-from-binary-to.html And created the following class: namespace Tes...

Multiple Connection Types for one Designer Generated TableAdapter

I have a Windows Forms application with a DataSet (.xsd) that is currently set to connect to a Sql Ce database. Compact Edition is being used so the users can use this application in the field without an internet connection, and then sync their data at day's end. I have been given a new project to create a supplemental web interface for...

Transactions with TransactionScope on Sql Compact Edition 3.5

Hi, I have question I'm developing small application to desktop in win Forms. I'm using SQL CE 3.5 SP1 for the database. When I make inserts on few tables by few methods I'm using the TansactionScope. When I use this methods alone I want to use normal Transaction from database connection. Is there anyway to check in called method if...

Does SubSonic 3.0 SimpleRepository support SQL Server Compact Edition?

Can someone confirm one way or the other if SubSonic 3.0's SimpleRepository supports SQL Server CE (Compact Edition)? I tried it and failed but I'm not sure if I'm doing something wrong or if it's not supposed to work. I'm finding conflicting information online. The SubSonic documentation page says that SQL Server CE is supported in Sub...