views:

54

answers:

1

Hi


1) Is there a reason why aspnet_Profile table doesn’t have ApplicationId column, while aspnet_Membership and aspnet_Roles tables do define ApplicationID columns?


2) If we create a profile for current user and then change the applicationName of our profile provider, then profile for same user couldn’t be read anymore. So it seems profile provider somehow knows that table entry for this user was made before applicationName was changed?

But how is that possible, since aspnet_Profile doesn’t contain ApplicationID column?


Thank you


EDIT:

2) I don't see how to change the application name of a profile provider - it is not an attribute of a provider entry in the profile section. It IS an attribute of a provider in the membership section, which makes sense


I was able to specify applicationName attribute, so I must assume profile provider does use it in some way:

   <profile defaultProvider="defaultP">
    <providers>
      <add name="defaultP"
           connectionStringName="connect"
           applicationName="_someName"


+2  A: 

1) Looking at the database tables for the aspnet security system, a Profile record is tied to a user, and a user is tied to an application. Since all profiles are tied to users, the profile itself doesn't need to explicitly specify an application (this is implied by the user's application).

2) I don't see how to change the application name of a profile provider - it is not an attribute of a provider entry in the profile section. It IS an attribute of a provider in the membership section, which makes sense.

Matt Hamsmith
I've edited my original post in response to your reply
PrgGnt
My mistake. Apparently it does exist. Intellisense in VS 2008 didn't list it as an option, or I was daydreaming of finer things and didn't notice it. Off-hand, I can only guess that the applicationName attribute is on a Profile Provider in case you do not specify a Membership Provider. A quick search of some Microsoft documentation revealed no information on why the Profile Provider's applicationName exists or may conflict with the Membership's Provider settings.
Matt Hamsmith
This web page (http://msdn.microsoft.com/en-us/library/aa479025.aspx) hints that the applicationName property on the profile provider helps to distinguish between user names (not ids) that may be equal but in different "scopes", and hence need different profiles.
Matt Hamsmith