Vuala ! NHibernate 2.0 is here Monday, August 25, 2008





The ALT.NET community is celebrating the new release (GA) of NHibernate 2.0. Believe it or not Nhibernate lead it's master Hibernate 3.2 with some features !
please have a look at the wiki , Thanks Fabio, Ayende and the community for making .NET tasty.



Enjoy It , Nhibernate your App !

ASP.NET and MySQL - membership provider (part 1) Tuesday, August 5, 2008

for many reasons you should stuck with MySQL on small to medium sized asp.net application. MySQL is always provided free of charge on shared hosting packages , if not , dozens are completely free of charge .
refer to this article for more details about about MySql different engines (requires registration) .
On Part 1 i will simply show how to instantly start using MySQL for securing your website members area using MySQL 5 native membership provider.

steps :

  1. download MySQL connecter , version 5.2 of the connector is robust !
  2. copy MySql.Data .dll and MySql.Web.dll to Bin. *
  3. membership provide is completely implemented on this version , use autogenerateschema="true" on web.config then running the "ASP.NET Configuration" will create the database schema for you. (website menu on Visual Studio).
    membership section on web.config shown on step 4.

  4. the whole bunch of providers configuration looks like *:


    <roleManager enabled="true" defaultProvider="MySQLRoleProvider">
    <providers>
    <add connectionStringName="LocalMySqlServer" applicationName="/"
    name="MySQLRoleProvider" type="MySql.Web.Security.MySQLRoleProvider, MySql.Web,Version=5.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </providers>
    </roleManager>
    <membership defaultProvider="MySQLMembershipProvider">
    <providers>
    <add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=5.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="3" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" autogenerateschema="true"/>
    </providers>
    </membership>
    <profile defaultProvider="MySQLProfileProvider">
    <providers>
    <add name="MySQLProfileProvider" type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web,Version=5.2.2.0,Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/" />
    </providers>
    </profile>

  5. run ASP.NET configuration , start adding users/roles and secure member's area.






* if you used the connector installer,these configurations will not appear on your web.config, but can be located on machine.config. copy them into your own web.config (Binaries also can be located on C:\Program Files\MySQL\MySQL Connector Net 5.2.2) , we don't expect them installed on the hosting server !

Enjoy MySql as much as you can ! it's free, lite and supported by Sun and the community.

on Part 2 of this series i will be showing the de facto blog tutor, we will build a simple blog without having to deal with MySql delicate using ActiveRecord OR/M. till then !