NHibernate, ActiveRecord and SQL2005

Recently I needed to do paging for a GridView using an ObjectDataSource and ActiveRecord. I wanted to use the SQL2k5 ROW_NUMBER function that I blogged about in this post to do real paging in sql but everything I had seen on using NHibernate with SQl2k5 said to use the SQL2k dialect. There was no indication that a SQL2k5 dialect even existed. However, during a search for another NHibernate question, I found a SQL2k5 dialect that someone had written to do exactly what I wanted. The code was available off the NHibernate contrib. site so I figured it worked and I could integrate it into my solution. As I was looking to figure out how dialects are integrated, I found that the dialect is already part of the NHibernate 1.2 release but none of the documents are updated to reflect this. To use the dialect, you just need to set <add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2005Dialect"/> in your ActiveRecord configuration.


Related posts

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

November 21. 2008 08:30 PM