According to ScottGu, an ASP.NET membership provider that works with SQL Server Compact 4 is not coming in the near future. This poses a problem, if you would like to use Forms authentication with a website using only SQL Server Compact 4.
To remedy this, I have implemented an ASP.NET Membership provider for SQL Server Compact 4.0 (CTP1), for use with Forms Authentication for small web sites using only a single SQL Server Compact 4.0 database. The project provides files that contain a Membership provider and Role provider for ASP.NET. (Note that SQL Server Compact 4 is in beta, and is not supported for production).
How to use the provided files (3 simple steps)
1. Change SqlCeMembershipProvider::encryptionKey to a random hexadecimal value of your choice.
2. Copy the three files in the /App_Code folder to your web sites' ~/App_Code folder.
3. Modify your web.config using the template on the CodePlex page
(if you are on a shared hosting server, you will have to set writeExceptionsToEventLog to false).
That's it - you can now create users, roles and use the ASP.NET login controls.
Site file layout (to verify that the provider is working):
If you encounter any bugs, have suggestions or any other issues, please provide feedback here