My ASP.NET membership provider is now available in version 2.1, that contains many improvements and some new features based on excellent community feedback – keep it coming!
The ASP.NET membership provider project was prompted last July by the comments to Scott Gu’s blog post about the upcoming version 4.0 of SQL Server Compact, and it’s support for ASP.NET.
Basically the Gu said: “We are looking to potentially ship a set of providers that work with it (and do not use stored procedures). The first beta won’t have this – but it is something we’ll hopefully enable in the future.”
So it was time to start coding, since the absence of a Membership provider would make SQL Server Compact less of an attractive option for ASP.NET web sites.
Since then, the database schema used has been refactored to be in line with the ASP.NET 4.0 SQL Server based schema, which resulted in the first NuGet Package being released in January 2011.
Now version 2.1 is available, also via NuGet:
Or from the CodePlex site.
The new features in version 2.1 are:
Profile provider included (contrib davidsk)
Two new methods: UpdateUserName and MigrateMembershipDatabaseToAspNet40 (contrib nekno)
Bug fixes (by various contributors, thank you all):
UpdateUser() doesn’t set LoweredEmail
GetUser w/ providerUserKey returns invalid information
Static salt leads to deterministic output, dynamic salt is better
Configuration error when using a provider
The latest release of the standalone version of my SQL Server Compact Toolbox, mainly for users that do not have Visual Studio 2010 Pro or higher, is available as a single .exe. It was actually a Tweet from @scottgal, that pointed me towards this excerpt from Jeffery Richters’ CLR via C#, Third Edition.
In order to implement in the WPF application, that is the standalone Toolbox, I added the following code to App.xaml.cs (and a Startup handler to App.xaml):
private void Application_Startup(object sender, StartupEventArgs e)
AppDomain.CurrentDomain.AssemblyResolve += (ssender, args) =>
//string names = this.GetType().Assembly.GetManifestResourceNames();
String resourceName = "ErikEJ.SqlCeToolbox." +
new AssemblyName(args.Name).Name + ".dll";
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
Byte assemblyData = new Byte[stream.Length];
stream.Read(assemblyData, 0, assemblyData.Length);
I also added all the Managed libraries that the Toolbox uses as Embedded Resources.
I use the following libraries, all from CodePlex:
WPF Property Grid
http://wpg.codeplex.com/ (for the SqlCeConnectionStringBuilder)
http://kbcsv.codeplex.com/ (for .csv file import)
SQL Server Compact Scripting Library (for database scripting)
Sample usage Sample usage
FabTab WPF Tab Control (the SQL Editor tabs)
And the Microsoft Data Connection Dialog (to prompt fro a SQL Server Connection) from http://archive.msdn.microsoft.com/Connection
Hope you find this tip useful.
The latest release of my ExportSqlCe SQL Server Compact scripting library and related command line utilities is now available on CodePlex.
This latest version of the command line utilities adds the capability to generate Schema Diff and DGML database graph files.
The schema diff option allows you to compare a SQL Server Compact database file with another SQL Server Compact database file or even a SQL Server database, and creates a script with the required ALTER TABLE etc. statements to synchronize the 2 database schemas.
The DGML option allows you to create a graphical view of the database tables and fields, the resulting .dgml file requires Visual Studio 2010 Premium or higher to be viewed. I blogged about DGML files earlier:
The latest documentation for the command line utilities is available here.
And both these file types can of course be generated from your own application, using the scripting library. I have some code samples available here.