I am looking to create a product catalogue site using Sitecore that will allow users to save products into custom lists they can manage when they use the website.
These lists could potentially contain hundreds of items each so using the standard custom profile attributes could get out of hand so I thought using an external data source would be the best way.
Are there any examples of how to implement a custom profile provider that stores to an external sql database? Is there a better way to do this?
UPDATE To expand on this. To test, I have downloaded the SQL Table Profile Provider example from here: http://code.msdn.microsoft.com/Using-the-SQL-Table-4c220996 and have that running using. I have then added a reference to this provider in the Sitecore project. In the web.config I have:
<profile defaultProvider="switcher" enabled="true" inherits="Sitecore.Security.UserProfile" >
<providers>
<clear />
<add name="sql" type="System.Web.Profile.SqlProfileProvider" connectionStringName="core" applicationName="sitecore" />
<add name="TableProfileProvider"
type="Microsoft.Samples.SqlTableProfileProvider, SQLTableProfileProviderCS"
connectionStringName="myProfileConnString" table="aspnet_Profile2"
applicationName="/" />
<add name="switcher" type="Sitecore.Security.SwitchingProfileProvider, Sitecore.Kernel" applicationName="sitecore" mappings="switchingProviders/profile" />
</providers>
<properties>
<clear />
<add type="System.String" name="SC_UserData" />
</properties>
</profile>
and under switchingProviders:
<profile>
<provider providerName="TableProfileProvider" storeFullNames="false" wildcard="%" domains="mydomain" />
<provider providerName="sql" storeFullNames="true" wildcard="%" domains="*" />
</profile>
and in /Security/Domains.config:
<domain name="mydomain" ensureAnonymousUser="false"/>
If I try to obtain the current users' profile and access the custom attributes using the same method as the SQL Table Profile Provider example project, the custom profile is always null.
I must be missing something in my configuration. Any suggestions would be greatly appreciated.