If you use NHibernate you should give it a try to ActiveRecord. Seems to be a nicer interface above NHibernate that I kind of like. You don't need any configs anymore, just objects to map to.
Regards, Corneliu I. Tusnea Readify | Senior Consultant M: +61 410 835 593 | C: [EMAIL PROTECTED] -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Frans Bouma Sent: Wednesday, 19 September 2007 7:00 PM To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] Open source Sql Helper > What I am actually doing is using a stored procedure to use temporary tables > to return a paged result set that I am displaying in a grid. > The stored procedure is only returning a list of say 20 ids that I am then > using NHibernate to load the object structures.Do you think this is a good > idea or how better could I accomplish this. NHibernate does paging by itself, so I think you should look into the paging support nhibernate uses. (I once peeked into their SQLServer 2005 paging code to see if they had the same errorous CTE SQL as I had, which was the case) It of course also depends on the amount of processing in the proc to produce the set: you have to specify that processing in your query specification you provide to nhibernate to fetch the entity objects. That's often the difficulty: sometimes the procedures are very complex and very big and use imperative logic instead of set logic (cursors, temptables with cursors, loops, ifstatements etc.) which is harder to convert to set-logic oriented queries in the o/r mapper. If your proc is straightforward (i.e. a select with a from/where etc.), it shouldn't be hard to write it in hql. FB > Thanks > [EMAIL PROTECTED] > > > > > Date: Wed, 19 Sep 2007 10:39:08 +0200> From: [EMAIL PROTECTED]> Subject: > Re: [ADVANCED-DOTNET] Open source Sql Helper> To: ADVANCED- > [EMAIL PROTECTED]> > > And which one would that be Frans?????> > > Would I recommend anything else but my own i > n this case? ;)> > > You can call stored procedures from NHibernate 1.2.> > > Then why don't you use it? Or do you want to get rid of the procs> altogether > and you're now wondering how to execute the SQL from C#?> > Most O/R mappers > allow you to execute o > wn queries or embed fragments> of sql into the produced query, to overcome a > lack of a given feature needed> for some obscure sql construct.> > FB> > > --- > ---------------------------------------------------------------------> Lead > developer of LLBLGen P > ro, the productive O/R mapper for .NET> LLBLGen Pro website: > http://www.llblgen.com> My .NET blog: http://weblogs.asp.net/fbouma> Microsoft > MVP (C#)> -------------------------------------------------------------------- > ----> > > > > [EMAIL PROTECTED]> > > > >> >> > > _________________________________________________________________ > Get free emoticon packs and customisation from Windows Live. > http://www.pimpmylive.co.uk > =================================== > This list is hosted by DevelopMentorR http://www.develop.com > > View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor? http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com