Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (12 sloc) 4.93 KB
---
layout: post
title: Linq2sql running on Sql Compact Edition - calling on VistaDb to clean-up their
act
date: '2008-06-24T23:21:00.001+01:00'
tags:
modified_time: '2008-06-24T23:21:16.302+01:00'
blogger_id: tag:blogger.com,1999:blog-4015568221071268916.post-6565858985414355836
comments: true
blogger_orig_url: http://serialseb.blogspot.com/2008/06/linq2sql-running-on-sql-compact-edition.html
---
<p>There is a lot of misunderstanding on this subject. Even competitors of Microsoft seem to not understand fully what Linq2sql is made of or what it actually covers. One of these competitors is Vistadb that says on their <a href="http://www.vistadb.net/compare_sql_compact.asp">product comparison</a>:</p> <blockquote> <p>SQL CE users will have to wait until the Entity Framework release before they can use LINQ against a SQL CE database.</p> </blockquote> <p>I sent them an email to warn them that their comparison was erroneous, and an exchange has started in which they've assured me I was in the wrong and have neither acknowledged the confusion nor updated their comparison. As such I feel inclined to bring the conversation to the community, to get knowledge out there. I have not received their authorization to reproduce the exchange, so I'll have to represent as accurately as I can, in my own word, the different points they made. And I hereby invite them, and you dear reader, to the conversation.</p> <p><em>Before you begin reading this, please note I do like the work the vistadb guys have been doing, I think it's a great internal database, and I probably would use their product still. But with greatness comes responsibility yada yada.</em></p> <h4>There is no provider model in linq2sql</h4> <p>This is an easy mistake to make if you don't spend your time in reflector. Linq2sql *has* a provider model that has been marked as internal late in the process, as described on <a href="http://blogs.msdn.com/mattwar/archive/2008/05/04/mocks-nix-an-extensible-linq-to-sql-datacontext.aspx">the Wayward Weblog</a>. If I was to guess the reasoning, I'd guess that there would've been a conflict of interest for partners to support both the <strike>Titanic</strike> Entity Framework model that leverages updates to the core ado.net classes and a provider model where they would've had to rewrite the sql code generation from the ground-up in linq2sql.</p> <p>But I would concede that, as it's not public, for all intent and purposes, there is no provider model *you can build against*.</p> <h4>Linq2Sql gives you a Visual Studio GUI and a mapping tool</h4> <p>This is accurate, and very relevant to our conversation. There is several aspects to linq2sql.</p> <ul> <li>A provider model, with a provider implementing access to Sql Server 2000, 2005 and 2008, as well as Sql Compact Edition 3.5. This is the bit of code responsible for translating between the model and the sql code</li> <li>An abstract mapping model defining types such as MetaTable, MetaType and MappingSource, that let you implement different mappings. Linq2sql ships with two of those, one for xml mapping files, one for attributes.</li> <li>Visual studio ships with a designer that lets you generate an xml mapping file through a point-and-click UI. This only supports the full-fledge Sql Server, and this is where the confusion may be coming from.</li> </ul> <p>So there is a bit more than a GUI and a mapping tool. It's a GUI, a mapping model and a provider model.</p> <h4>Sql Compact Edition queries don't support Linq, the compiler does</h4> <p>Well I've struggled quite a bit to understand that one. Linq queries are compiled by the compiler as extension methods or interfaces defined by the implementations of Linq (Xml, object, Sql, etc). However, I fail to see any connection with Sql Ce itself, as the one querying the database is the provider that, indeed, supports Linq2sql just fine. The provider is indeed distributed with Sql Ce 3.5.</p> <h4>Microsoft does not use Linq2sql as a term that covers Sql Compact Edition and it's unsupported</h4> <p>I don't see how it relates to the technical conversation. And the download page of Sql CE 3.5 specifies the following.</p> <blockquote> <p>SQL Server Compact 3.5 introduces a host of new features including LINQ to SQL support</p> </blockquote> <p>Again, it doesn't seem like unsupported to me.</p> <h4>Conclusion</h4> <p>Vistadb is a strong product in its own right. The product comparison however contains a mistake and the company hasn't responded to the two emails I've exchanged with a catchall email address.</p> <p>All in all, this highlights two points. Microsoft has a communication problem around Linq2sql; Iif your competitors don't understand your product well, imagine your customers. Secondly, if you want to put product comparisons you should *really* double-check your facts. Responding in person to emails rather than through a customerservices@... address, and double-checking before responding the second time would probably have kept me a bit happier.</p>