I know I can get a reference to the default Profile in ASP.NET with code like this:
ProfileBase p = ProfileBase.Create(username);
(I know there is also HttpContext.Current.Profile, but that is for the current user, and I need to get the profile by username.)
The above code works only for the DEFAULT provider as defined in the defaultProvider attribute in web.config:
<profile defaultProvider="SqlProfileProvider">
<providers>
<clear />
<add applicationName="Gallery Server Pro" connectionStringName="SQLiteDbConnection"
name="SQLiteProfileProvider" type="GalleryServerPro.Data.SQLite.SQLiteProfileProvider" />
<add applicationName="Gallery Server Pro" connectionStringName="SqlServerDbConnection"
name="SqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" />
</providers>
<properties>
<add name="ShowMediaObjectMetadata" defaultValue="false" type="String" allowAnonymous="true" />
<add name="UserAlbumId" defaultValue="0" type="Int32" allowAnonymous="false" />
<add name="EnableUserAlbum" defaultValue="true" type="String" allowAnonymous="false" />
</properties>
</profile>
How would I get a reference to a non-default provider? For example, the provider named SQLiteProfileProvider shown above? I have it working for roles and membership:
RoleProvider rp = Roles.Providers["SQLiteRoleProvider"];
But the Profile object model is different and I can't figure it out. Thanks for any help!
Roger Martin