BT

Your opinion matters! Please fill in the InfoQ Survey!

Create Your Own ASP.NET Providers

| by Jonathan Allen Follow 256 Followers on Oct 15, 2006. Estimated reading time: 1 minute |

A note to our readers: As per your request we have developed a set of features that allow you to reduce the noise, while not losing sight of anything that is important. Get email and web notifications by choosing the topics you are interested in.

With version 2.0, ASP.NET has allowed developers to create their own custom providers that plug into the website framework. These providers cover the areas of Membership, Roles, Site Map, Session State, Profile, Web Event, and Web Parts.

The first option is to base your custom version on the built-in versions. Fortunately Microsoft has released the complete source code for the SQL Providers as well as extensive documentation. Scott Guthrie has collected the key resources to get you started.

Not all developers are satisfied with this option. In theory it is possible to modify the SQL Providers to work with your existing infrastructure. But as Michal Valášek says, 

[The] database structure used by these providers is pretty complicated and almost impossible to interconnect with your own tables etc. Drop the “almost” for profile provider.

To address this, he has released the Altairis Simple ASP.NET SQL Providers through CodePlex. They provide the minimum functionality needed to work with the framework and a very simple table structure. This makes them ideal for grafting onto your existing infrastructure. Currently providers for Membership, Role, and Profile are available. They are written in C# and only require one or two tables each.

While in theory a developer can swap out any provider, sometimes there are internal dependencies that have to be considered. For example, the Hao Kung's Table Profile Provider is coupled to the default Membership provider.

For those working with database other than SQL Server, there are options. Rakotomalala Andriniaina has offered source code for Membership and Role providers for MySQL.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT