Cerveser

MySQL

ASP.NET

Using the MySQLProfileProvider

The ASP.NET MembershipProvider is also available for the MySQL database.

The Membership Provider doesn’t come with much fields for profile information, like firstname and surname. A shortcut to implement the name would be to use the “Comment” field instead. If you don’t use the comments off course.

An other way to expand the profile of a user is to use the MySQLProfileProvider. You just add the extra columns in the web config.

<profile enabled="true" defaultProvider="MySQLProfileProvider" inherits="UserProfile">
      <providers>
        <clear />
        <add name="MySQLProfileProvider"
             type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=6.8.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
             applicationName="MemberApp"
             description="Profiles"
             connectionStringName="MySqlServer"
             writeExceptionsToEventLog="False"
             autogenerateschema="True" />
      </providers>
      <properties>
        <add name="firstname" />
        <add name="surname" />
      </properties>
    </profile>

This solution doesn’t work with an Empty Web Application, only with website projects in Visual Studio.

An example to extend the user profile with an Empty Web Application can be found on Jon Galloway’s blog and here.

To top