Tip/Trick: Source/Documentation for Simple ASP.NET 2.0 SQL Providers Published

One of the most popular features in ASP.NET 2.0 was the introduction of the "provider model" for the built-in ASP.NET Application Service APIs.  The provider model ensures that the storage/implementation for services like Membership, Roles, Profiles, Health Monitoring, Session State, and Site Navigation is extensible, and it allows a developer to easily plug-in alternative implementations if they want. 

Earlier this year I blogged about how we shipped the source code for the built-in ASP.NET 2.0 Providers on MSDN, and published 130+ pages of really good documentation that walksthrough their implementation and behavior.  If you are looking to adapt the existing providers (which are pretty feature rich and in-depth), then you'll find these whitepapers and source a good resource to check-out.  One downside with starting off with the code within the built-in feature-rich/optimized providers, though, is that the source code might be bigger and more complicated then you might like, and the database schema might not map to the database structure you want. 

Michal Valasek sent me mail earlier today pointing me at a really cool CodePlex project he has started that provides a simplified set of SQL Provider implementations for the ASP.NET Membership, Roles and Profile APIs.  These use a nice straight-forward database schema and can be easily adapted for your application and/or integrated into existing tables you might already have.  You can download the source code for them here.  I definitely recommend checking them out and bookmarking the project - they provide a really great way to get started with custom providers.

For learning more about the ASP.NET Provider Model, I also recommend checking out a great Code-Camp presentation that Paul Wilson did complete with a nice provider implementation built with his ORMapper that you can download here.  You can also find other non-SQL provider implementations (including ones for MySql, SqlLite, Access and more) via my ASP.NET Security Resources Page.

Hope this helps,

Scott

Published Friday, October 13, 2006 9:36 PM by ScottGu

Comments

# re: Tip/Trick: Source/Documentation for Simple ASP.NET 2.0 SQL Providers Published

Saturday, October 14, 2006 4:59 AM by Patel Shridevin
Thanks, I really like the providers sample by Paul Wilson. Well, just hope the Paul regains his MVP status because he is still valuable and an ASPNET guru.

# re: Tip/Trick: Source/Documentation for Simple ASP.NET 2.0 SQL Providers Published

Saturday, October 14, 2006 11:09 AM by ScottGu

Hi Patel,

Paul is absolutely a super-valuable ASP.NET guru.  He is also a member of the ASPInsiders group which helps give the product team feedback on future releases and plans.

The MVP program is a separate program within Microsoft from product teams (we actually don't get any vote on who is in or out to avoid favoritism), and is focused on a person's community engagement over the last year alone (that is the renewel criteria).

Paul will always be a MVP in my book though.

Thanks,

Scott

# re: Tip/Trick: Source/Documentation for Simple ASP.NET 2.0 SQL Providers Published

Sunday, October 15, 2006 10:17 PM by John Lieurance
Scott, Thank you for the key word needed to find the 120 pages of documentation ("Provider Model"). I'm new to ASP and have been chipping away at Web Parts for about 2 weeks now. As a sessioned programmer I run SQL Server on all of my development platforms and at times have been pounding my head against the wall trying to get it to work with SQL 2k5. I finally got it done and realized along the way that a good review of the provider's architecture was in order. Reviewing all of the HOW-TO's and libraries associated with Web Parts didn't do me much good. By chance I happened upon your blog while surfing MSDN and whalla! Two words in the index search of MSDN and I'm now on my way to a good review of the "provider model". Johnny

# re: Tip/Trick: Source/Documentation for Simple ASP.NET 2.0 SQL Providers Published

Monday, October 16, 2006 12:46 AM by vikram
hmmm. The provider sample by paul Wilson is great. I have read some more article by him and liked them very much. Vikram

# re: Tip/Trick: Source/Documentation for Simple ASP.NET 2.0 SQL Providers Published

Monday, October 16, 2006 11:47 AM by Albert Pascual
Always posting in what I am working on. Thanks. I had to inherit Membership and Roles to add the implementation in Oracle, now I need to know about Authentication. Keep posting.

# re: Tip/Trick: Source/Documentation for Simple ASP.NET 2.0 SQL Providers Published

Monday, October 16, 2006 11:56 AM by Colin Blair
Did you ever get an answer on releasing the source for the Active Directory providers?

# re: Tip/Trick: Source/Documentation for Simple ASP.NET 2.0 SQL Providers Published

Tuesday, October 17, 2006 9:51 AM by john mcfetridge
I have written an article on a database provider model for membership service that uses DLinq and Datasets as provider implementation examples http://www.sandkeysoftware.com/articles/Provider.htm or jmcfetridge.blogspot.com

# re: Tip/Trick: Source/Documentation for Simple ASP.NET 2.0 SQL Providers Published

Tuesday, October 17, 2006 10:31 AM by ScottGu

Hi Colin,

Unfortunately I don't have an ETA on when the ActiveDirectory provider source will be published. :-(

Sorry!

Scott

# re: Tip/Trick: Source/Documentation for Simple ASP.NET 2.0 SQL Providers Published

Tuesday, October 17, 2006 1:33 PM by Dee
it's too bad MS has dropped VB support and no longer offers providers written in VB.net. that would be helpful...

# re: Tip/Trick: Source/Documentation for Simple ASP.NET 2.0 SQL Providers Published

Wednesday, October 18, 2006 12:21 AM by ScottGu

Hi Dee,

There are plenty of articles on how to build providers written in VB.  Here is a good one I recommend: http://www.devx.com/asp/Article/29256

Hope this helps,

Scott

# re: Tip/Trick: Source/Documentation for Simple ASP.NET 2.0 SQL Providers Published

Friday, October 27, 2006 5:02 AM by Ajith
Hi Scott, If we have to use ASP.NET 2.0 Membership and Roles API with Oracle What need to be done? Is there any tool available similar to aspnet_regsql.exe? Or is it possible to download or purchase the Oracle equivalent schema of aspnetdb?

# re: Tip/Trick: Source/Documentation for Simple ASP.NET 2.0 SQL Providers Published

Saturday, October 28, 2006 12:13 PM by ScottGu

Hi Ajith,

One option to consider for building your own Oracle providers is to look at this source: http://weblogs.asp.net/scottgu/archive/2006/10/13/Tip_2F00_Trick_3A00_-Source_2F00_Documentation-for-Simple-ASP.NET-2.0-SQL-Providers-Published.aspx

I believe you could adapt it for an Oracle database instead.

Hope this helps,

Scott

# 技巧和诀窍:简单的ASP.NET 2.0 SQL提供器的源码和文档发布了

Friday, November 03, 2006 4:35 AM by scottgu

技巧和诀窍:简单的ASP.NET 2.0 SQL提供器的源码和文档发布了

# re: Tip/Trick: Source/Documentation for Simple ASP.NET 2.0 SQL Providers Published

Wednesday, March 14, 2007 4:32 PM by Brad

Thanks for blogging about the Profile Model.  FYI, the CodePlex project links are crashing.

# May 22nd Links: ASP.NET, Visual Studio, Silverlight, WPF and .NET

Tuesday, May 22, 2007 2:38 PM by Blogs

One of the things I'm going to try and start doing is a weekly blog post of useful/interesting links

# Enlaces del 8 de Octubre: ASP.NET, ASP.NET AJAX, Silverlight y .NET « Thinking in .NET

Pingback from  Enlaces del 8 de Octubre: ASP.NET, ASP.NET AJAX, Silverlight y .NET « Thinking in .NET