How to execute an arbitrary query

Posts   
 
    
Waveslam
User
Posts: 18
Joined: 20-Nov-2006
# Posted on: 27-Feb-2007 03:53:25   

Hi

I have a question that seems so fundamental I fear I may be missing some crucial point somewhere... ;-)

I am familiar with using the generated code to populate Entitys, COllections, call stored procs, read views etc. However, I cant seem to find any description of how to construct and execute an arbitrary SQL query within the LLBLGen framework. By this I mean I want to generate a SQL Select command in code at runtime, execute it and then iterate through the rows in the returned resultset.

It seems the only way to achieve this would be to define my arbitrary select as a View in the DB and generate appropriate code using LLBLGen.

So is this possible, or have I missed the point...?

Cheers Brett

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 27-Feb-2007 05:14:13   

Take a look at dynamic lists. If you have any questions how to use them just let us know, but they sound like they would do what you are needing.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 27-Feb-2007 10:14:35   

Another way is to fetch a datareader, using the fieldsset as you'll use with a dynamic list.

Frans Bouma | Lead developer LLBLGen Pro