Microsoft Sql Server Compact 4.0

Active4 years, 11 months ago

My website is a .net 4.5 mvc site built with VS 2012. I have a SQL Server Compact DB in my app_data folder. All works great on my localhost. I deploy to Azure website and get this error?

So, I've been trying to figure out why intellisense in Visual Studio 2012 Express won't work. I tried repairing it and it says that the SQL Server Compact 4.0 won't load. When I try to download the. Where is the SQL Server Compact Edition 4.0 SDK? Bonus Reading In order to create a database in SQL Server Compact Edition you must call the function MECreateDatabase exported from sqlceme40.dll.

Unable to find the requested .Net Framework Data Provider. It may not be installed.

I've googled it and get lots of possible answers, but none specific to Azure and SQL server compact. So my question is simple. Does a windows Azure Website which is deployed to an Azure shared hosting server support SQL Server Compact? If so, what do I need to do to eliminate the aforementioned error and make it work?

Naveen Vijay
12k5 gold badges51 silver badges74 bronze badges
user2128244user2128244
Compact

3 Answers

Second Wenchao Zeng of Microsoft the Azure don't support Sql Compact.

I could use once but this is not recommended because the Windows Azure work with replication of the data (this is the cloud, remember?) and the Sql CE does not support this functionality. If you can to put a Sql CE in Azure sometimes will not get access or users see data outdated or broken because the async.

The best way is you to use the Azure Sql ou BLOB storage.

MayogaXMayogaX

It certainly is possible to use SQL Server Compact on Windows Azure. However, you need to ask yourself:

Will I change anything in database?
This includes adding, updating and removing data. If you do, you should not use SQL Server Compact on Windows Azure. Because, if you use SQL Server Compact on Windows Azure and change anything in the database, you'll run into two problems:

  1. Data is not replicated.
  2. You risk losing data.

Data is not replicated
If you change anything in the database, the changes stays local. This means that if you have multiple instances running your web application, then each web application will have their own database, and if you change something in one of them, the change won't be replicated to other instances, which will result in unpredictable behaviour in your application.

You risk losing data
If you change anything in the database after deployment, you risk losing data, because Windows Azure might decide to redeploy your instance to another virtual or physical machine. When this happens, the new instance will be setup with the deployment package you originally uploaded to Windows Azure, and this package does not contain any changes you make to the database. And this redeployment can happen at any time for several reasons.

Conclusion
So, SQL Compact on Azure? Sure, no problem if your data is read-only. However, note that you won't get the performance you would with SQL Azure. But if your need changes down the road, you can always migrate your application from SQL Server Compact to SQL Azure.

If you want to use SQL Server Compact with Windows Azure, you can use the 'private deployment' method, as explained on 'ErikEJ's blog.

Edit: Microsoft has announced that they now provide 1 free 20 MB SQL Azure Database for every Azure subscription. This means you can create a subscription and create a free website, with a free SQL Azure Database. (As long as it's less than 20 MB) You can also have multiple Web Sites associated with the same SQL Azure Database for free. So, if you're considering SQL Server Compact on Windows Azure because your database will be very small and you don't want to pay for a 100 MB database, you can consider this option. In most cases, it will be a better solution. Your website will perform better, your database performance will be better and you have the ability to change your data and it will be replicated.

RenéRené
8,0464 gold badges35 silver badges49 bronze badges

It's possible for SQL Server Compact 4.0 on Azure!!

I write an an article for it

And this is the English version I found

By few step:

Below is the solution after my research:

Step by Step like this:

  1. Install two nuget: EntityFrame.SqlServerCompact & Microsoft SQL Server Compact Edition

  2. put your SQL database file(.sdf/.mdf) in APP_Data folder(Put the connection string like this in order to use it:

  3. Publish full project include above SQL database file to AzureWebsites.

  4. you can find it can work well and is totally free.

SingSing
2,6172 gold badges17 silver badges34 bronze badges

Not the answer you're looking for? Browse other questions tagged azure or ask your own question.

Active4 years, 1 month ago

Where is the SQL Server Compact Edition 4.0SDK?

Bonus Reading

In order to create a database in SQL Server Compact Edition you must call the function ME_CreateDatabase exported from sqlceme40.dll:

The function is not documented on MSDN, and the header files do not ship with the redistributable (obviously).

MSDN mentions 3 Compact Edition header files:

  • sqlce_err.h: Error codes used by database
  • sqlce_oledb.h: OLEDB standard programming interfaces
  • sqlce_sync.h

That page also mentions that, if i had the SDK, the header files would be located in:

SQL Server Compact 4.0 header files are installed under %ProgramFiles%Microsoft SQL Server Compact Editionv4.0Include.

But i don't, so they aren't:

So where is the SQL Server Compact Edition 4.0 SDK?

Bonus Chatter

Download Microsoft Sql Server Compact 4.0

Building an OLE DB Application (SQL Server Compact)

The next step in building an OLE DB-enabled application is to include the appropriate header files. In the main entry point for your application, add include statements for the SQL Server Compact OLE DB provider and the SQL Server Compact error file:

Ian Boyd
Ian BoydIan Boyd
129k202 gold badges725 silver badges1041 bronze badges

Microsoft Sql Server Compact 4.0 Service Pack 1 Installation Failed

3 Answers

The files are included in the package SSCE 4.0 Design Tools (SSCEVSTools-ENU.msi) (documented here). This executable is available on the Visual Studio 2012 Premium Edition DVD. Possibly in other editions and verisons as well, but this is the only one I have.

I needed the files myself and after digging around for an hour I found it there.

NitramkNitramk
4816 gold badges13 silver badges41 bronze badges

As Nitramk posted, I found SSCEVSTools-ENU.msi on the VS 2012 iso's in packagesssce40. It's also included in the 2012 Ultimate trial (and probably Pro). As of now, the trials are still available from MS. Search for 'visual studio 2012 ultimate trial' or 'visual studio 2012 trial'.

Sql Server Compact 3.5 Sp2 Download

Note that I don't see them in VS 2013 or 2015.

GravityWellGravityWell
1,0411 gold badge15 silver badges21 bronze badges

You have to use the 'Microsoft Web Platform Installer 3' link on the blog page and install that.Then you'll get the header files & samples installed into C:Program Files (x86)Microsoft SQL Server Compact Editionv4.0

SimonSimon

Not the answer you're looking for? Browse other questions tagged sql-serversql-server-ce or ask your own question.