Use ASP.NET profile or not?

I need to save several authenticated user attributes (I use the membership API), and I need to choose between using profiles or adding a new table with UserId as PK. It seems that using profiles is quick and requires less work. However, I see the following disadvantages:

  • Profile values ​​are flushed to a single ntext column. At some point in the future, I will have SQL scripts that can update user attributes. Querying the ntext column and trying to update the value sounds a bit to me.
  • If I want to add a new user property and would like to assign a default value to all existing users, is this possible?

My first impression was that using profiles can lead to maintenance headaches in the long run. Thoughts?

+6
asp.net-membership
source share
3 answers

An article was published on MSDN (now on ASP.NET http://www.asp.net/downloads/sandbox/table-profile-provider-samples ), which discusses how to create a profile table provider. The idea is to store the profile data in a table compared to a row, which simplifies the query using only SQL.

Moreover, SQL Server 2005/2008 provides support for retrieving data through services and CLR code. You could access profile data through the API, and not directly to the underlying tables.

As for item # 2, you can set default values ​​for properties, and although it will not immediately update other profiles, the profile will be updated the next time it is accessed.

+3
source share

It seems you answered your question. If your point 1 is likely to happen, then the SQL table is the only reasonable option.

0
source share

Check out this question ...

ASP.NET created in user profile and old user class / tables

The first hint that embedded profiles are poorly designed is the use of delimited data in a relational database. There are several cases where delimited data in an RDBMS makes sense, but it is definitely not one of them.

If you have a specific reason for using ASP.Net profiles, I would suggest that you go with separate tables.

-one
source share

All Articles