Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Provider: System.Data.SqlServerCe.3.5 is not installed

Hi I am trying to use LINQ with SQL Server CE. I generated the dmbl file with SqlMetal, added it to the project, and also added a reference to assembly System.Data.SqlServerCe.dll

My app is WPF based on .NET4.0 and is built as x86.

On my PC SQL Server CE is installed.

I tried the following code:

const string connStr = @"Spiri_SQL_CE_DB.sdf";
var dataContext = new Spiri_SQL_CE_DB(connStr);
var testNicks = dataContext.TestNick;

But I get this error:

Cannot open 'C:\Users\Jan\Documents\Visual Studio 2010\Projects\C#\Pokec_Messenger_Project\Pokec_Messenger\DB_TEST\Spiri_SQL_CE_DB.sdf'. Provider 'System.Data.SqlServerCe.3.5' not installed.

What am I missing? A reference to some assembly, or something else?

IF I RETARGET APP ON .NET3.5 IT WORKS GOOD !


1 Answers

You need Microsoft SQL Server Compact 3.5, see here for download links: http://www.microsoft.com/sqlserver/2005/en/us/compact.aspx

Usually, this database just works with x-copy deployment, so once you've installed it on your dev machine, you can just copy it over your work environment directory.

like image 154
Simon Mourier Avatar answered Mar 25 '26 11:03

Simon Mourier



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!