I received mail today from the SQL Server Compact Edition folks at Microsoft on my blog post on using SQL Server CE 3.5 beta, Visual Studio Beta 2, LINQ, and EDM. The current plan is:
1. Visual Studio 2008 will not ship with LINQ to SQLCE designer support. SQLMetal works just fine with SQLCE, though, as I’d mentioned.
2. There is planned future support for using SQLCE with EDM and LINQ to Entities when EDM ships after Visual Studio 2008 (VS 2008 SP1?).
3. There is a fix in the works for the FK issue that I had with the SQLCE Northwind sample database and SQLMetal.
Along these lines, I asked about the integration of LINQ to SQLCE with the updateable, scrollable, cursor-like behavior of SqlResultSet. Because SQLCE is an embedded database (“the engine” loads into your application) using the DataSet with SQLCE programming adds a layer of buffering (read: memory allocation and data copying) between the data and you. SqlResultSet is a perf win over using DataSet, and using LINQ to SQLCE or EDM to SQLCE, although they don’t use the DataSet, doesn’t allow in-place updating like SqlResultSet does. And they do use memory allocations rather than read directly from the SQLCE database. The current LINQ to SQLCE doesn’t support SqlResultSet-like behavior yet, but perhaps in future…
One thought on “More info on SQLCE 3.5 beta and LINQ and EDM support”
Workaround for the lack of LINQ to SQLCE designer support might be to use SQL Express db with the same schema as CE database. Then when instantiating Data Context pass SqlCeConnection. You have to remove "dbo." from TableAttribute (from [Table(Name="dbo.Customer")] to [Table(Name="Customer")]). It’s a bit of a hassle but it’s doable. I was able to successfully insert and select data from the database so far. My project is small and more of a test project so I don’t expect any problems with the approach, but if I do I’ll let you know 😉
Comments are closed.