ASP.NET Column based Profile Provider

53 sec read

Some of my colleagues are often reluctant to use ASP.NET 2.0 profile provider to store profile data for their web applications. The main reason for this is the fact that the default SqlProfileProvider that ships with ASP.NET 2.0 “blobicizes” Profile data using string, XML or binary serialization prior to storing information in SQL Server. This obviously puts a rather large overhead when you need to query your profile data.

What most developers aren’t aware though is that you can build your own custom profile provider to store Profile data “in the clear” in the database so that the data is available for querying and use in stored procedures.

As a matter of fact Microsoft provides an SqlTableProfileProvider sample implementation which stores each Profile property in a separate database column without serializing it, which means that the Profile property can be easily queried (of course the profile property type needs to be compatible with the target database column).

There is also a second sample provider, SqlStoredProcedureProfileProvider, which maps each Profile property to a parameter on a custom stored procedure. Like the table based provider, this provider expects that each Profile property is of a type that is compatible with its corresponding stored procedure parameter. The powerful aspect of the stored procedure based provider is that other than the requirement to implement some stored procedures with a specific set of parameters, you can implement whatever business logic you need in the stored procedures to map the Profile data to your own database schema and database logic.

You can learn more about these profile providers here.

Cloud development with Azure and Visual Studio

This session is so awesome, I just had to post it here so that I can play it over and over again… What great...
kpantos
5 sec read

StressStimulus stress testing tool

If you ever created a professional website/application you’ll probably know the value (you’ve probably learned it the hard way as I did ) of...
kpantos
26 sec read

Debugging Web Sites using IIS Express

Microsoft recently released a new flavor of IIS 7.x that is optimized for developer scenarios called “IIS Express” as part of WebMatrix. IIS Express...
kpantos
56 sec read

One Reply to “ASP.NET Column based Profile Provider”

Leave a Reply

Your email address will not be published. Required fields are marked *