Linq to Sql and SqlCE

imageIf you add a dbml to a project using the Visual Studio 2010 tools and then try to drag an object from a SqlCE database into the model it will fail with the message “source not supported”.
I don’t see any reasons it shouldn’t work…
imageChecking SqlMetal it has a description saying it supports SqlCE. Start the “Visual Studio Command Prompt”, change to the directory of the project and run
‘sqlmetal /dbml:Database1.dbml Database1.sdf’
Now, add the new file – Database1.dbml to your project (add existing item) and voilá, you can now edit the dbml model with the LocalDatabase elements.
To test, add any Linq query and run it.
Label ‘Label1’ is for Guid
Label ‘Label2’ is for Guid
[Any key to quit]
Works for me! Smile

About skattefuten

Check my about page :-)
This entry was posted in .Net and tagged , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s