Hello All,
I am trying to create a local database programmatically using C# with Sql server compact edition. I have Visual Studio 2019 and created a project with .NET framework of version 4.8. I have the following code which will create a database.
string connectionString = "DataSource=\"test.sdf\"; Password=\"mypassword\"";
SqlCeEngine en = new SqlCeEngine(connectionString);
en.CreateDatabase();
Unfortunately, when executed it throws the following error:
Unable to load the native components of SQL Server Compact corresponding to the ADO.NET provider of version 8876. Install the correct version of SQL Server Compact. Refer to KB article 974247 for more details.'
What is the reason of the error? Also, the error pointed to the second line of the above code where I have initiated SqlCeEngine.
It would helpful, if some one can suggest me which version is the correct version.
Thanks in Advance.