sql-server-ce

Why is there an err parsing this DDL, and why can't the engine be more specific about locating it?

白昼怎懂夜的黑 提交于 2019-12-12 05:26:53
问题 With this DDL ("BLA" is a tablename in the form "CCR130329093342") ALTER TABLE BLA ADD salvation float NOT NULL WITH DEFAULT ...I'm getting, " There was an error parsing the query. [Token line number, Token line offset,, Token in error,,] " Okay, then, which line number? offset? It knows/thinks there's a problem, but can't or won't say what or where. Is there anything obviously wrong with this DDL? Should it be this instead: ALTER TABLE BLA ADD salvation float NOT NULL WITH DEFAULT 0.0 ?

LINQ2SQL with MS SQL Server Compact 3.5 SP2: BadImageFormatException

妖精的绣舞 提交于 2019-12-12 04:38:16
问题 I am having trouble using a .sdf database file with Ling2SQL. I am working with VS2010 on .NET 3.5. What I have done so far: Created sdf file and added tables and data (located in project folder) Copied SQLMetal.exe and SqlMetal.exe.config to the project folder and called it with: SQLMetal.exe database.sdf /dbml:DataOffline.dbml /namespace:CTcalc /pluralize Added dbml file to the project (designer.cs is created) Add new method to designer.cs public DataOfflineDataContext() : base(global:

How can I circument the “80004005 There is a file sharing violation…” err msg on a SQL Server CE database?

℡╲_俬逩灬. 提交于 2019-12-12 04:37:22
问题 I am getting error 80004005 There is a file sharing violation. A different process might be using the file. when trying to open a SqlCeConnection . Is there a way to close a SQL Server CE database programmatically, to try to nip that problem in the bud? Something like (pseudocode): SqlCeDatabase SQLCeDb = "\My Documents\HHSDB003.sdf"; if (SQLCeDb.IsOpen) { SQLCeDb.Close(); } ? Or a way to set the connection so that it doesn't care if the database is open elsewhere/wise, such as:

Unable to access database (SQL Server CE / Windows Mobile 6.5)

对着背影说爱祢 提交于 2019-12-12 04:25:21
问题 I'm creating an application for a Windows Mobile 6.5 device, part of which is supposed to replicate a SQL database when the device plugged in, to have a local copy when unplugged (because no connection). So, to have a local database I followed the "Northwind" tutorial for SQL Server CE (with my own test database), but constantly run into the issue that the device can't connect to the database. I can't debug (because I have to transfer the program to the device to test it every time) but I get

SQL Server CE 4.0 Entity Framework, query runs realy slow (compared with SQL Server CE 3.5)

 ̄綄美尐妖づ 提交于 2019-12-12 04:06:56
问题 I'm writing a small business Winforms application in C#, .NET 4.0, using Entity Framework to query database. I used SQL Server CE 3.5 as my database and this specific (exactly the same) query executed really fast (didn't measure it, but I didn't notice any delay). Then I switched to SQL Server CE 4.0 and I tested it on the same query and it needed around 4 seconds to execute. Am I doing something wrong or maybe SQL Server CE 4.0 wasn't meant to be used in Winforms, or...? Should I just switch

EntityFramework 5 (Model First) and SQLCE: what 'Type' property to store an image?

二次信任 提交于 2019-12-12 03:33:34
问题 Framework: In an asp.net MVC 4 project I'm using EntityFramework 5 for the first time and have chosen to use "Model First" due to the ease of model implementation (the ability to generate the db schema once the model is created using the designer). Also, I've chosen to use SQLCE opposed to SQLExpress based on the lightweight nature and requirements of the project. Question: What is the best property Type selection in the .edmx designer for saving images in the compact sql database? I'm

Gracefully handle background task when app tombstones

限于喜欢 提交于 2019-12-12 03:19:30
问题 I'm using the async ctp and have a task that runs in the background. It works great but throws an exception when it's running and the app is tombstoned. The exception is related to the database context being null. The docs say: When an application is tombstoned, the underlying database connections are closed. To return to its previous state after tombstoning, an application needs to redo any queries it had performed before it was tombstoned. I've tried using a cancellationtokesource but this

Why does SQL Server CE not allow this trigger to fire?

半城伤御伤魂 提交于 2019-12-12 03:19:01
问题 We're using a SQL Server CE database. I understand that there are limitations to the types of trigger that work with a SQL Server CE database. For instance, the trigger on a SQL Server CE table cannot call a stored procedure, but it can update / insert into another table. What we are after is a trigger to send an email notification when there is a modification (insert/update/delete) to a table. We know that if we set the trigger directly on the table to send an email (EXEC msdb.dbo.sp_send

How can I make my SQL Server CE connection open faster?

此生再无相见时 提交于 2019-12-12 03:14:20
问题 I need some help, I have a SQL Server CE database in my project and I open the connection when loading the first form and keep it open, you know the usual: if (con.State == ConnectionState.Closed) { con.Open(); } It works perfectly fine, but that first moment when it's opening the connection is toooooo long. My question is, isn't there a way to make that opening process go a little faster so that my program's users won't fall asleep waiting for it to open? Thanks in advance... 回答1: A given

SqlCe 4.0 + EF 5.0 stopped working in VS2012

青春壹個敷衍的年華 提交于 2019-12-12 02:14:35
问题 I have created an application almost ready to distribute to clients. It took my several months. Everything worked fine but then I installed VS2012 and all my tests stop working. I tried everything but finally gave up and reinstalled my whole computer. Same setup as before but everything clean: Windows 7 64bit, VS2012, SQL2012, etc. Now all tests worked fine so I was happy. But now I ran into a new trouble. When targeting SqlCe 4.0 it does not work. My application will sync with a central SQL