Monday, February 7, 2011

Using Linq with SQL Server Compact Edition

Hi,

Somebody recently brought to my notice that you cant use SQl Server Ce with LINQ. on investigation i found this to be partailly true.

You cannot use the VS 2008 ORM designer with the sql server ce the way you could use it with any other sql server version. It seems the LINQ Db designer does not support the sql server ce provider( don't know why).
So whats the work around, just use the sqlmetal command line interface to create the dbml, and add that to your solution, after which you can now use the design view to carry out any further changes.
You can use the sqlmetal from your visual studio command prompt.
e.g
SqlMetal.exe "e:\products.sdf" /dbml:e:\products.dbml /namespace:Common.DataLayer

No comments:

Post a Comment