Customize SQL command

Posts   
 
    
Posts: 12
Joined: 30-Nov-2007
# Posted on: 30-Nov-2007 10:55:36   

Hi, simple_smile I can you adapter to get data, filter and sorting . but how can I do a customized query ? for example , 1. if item number is exists. (single table query) 2. Get the Query result for a Report preview.(multi tables join query)

is there a better way to do a query and get a dynamic result(table/view)

by the way , I think LLBLGen is better than DataSet/DataTable but I'm a new user. Wish you can teach me more.

thanks a lot

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 30-Nov-2007 10:58:56   

Could you please explain in more details using SQL queries?

Tell us what's the SQL code you want to customize and execute.

Posts: 12
Joined: 30-Nov-2007
# Posted on: 30-Nov-2007 11:13:59   

sorry for my English first!

ex: there is 2 tables : Sc and ScItem I want to design a report to print(preview) the "Order Detail Report" And Query command would be like that:

select * from Sc left join ScItem where Sc.ScNo = ScItem.ScNo
or 
select * from Sc, ScItem where where Sc.ScNo = ScItem.ScNo

then I will get a result and this result is a table but not 2 tables.

such as query command, how could I implement through LLBLGen and to use this Entity ? Hope you know my question.

flushed

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 30-Nov-2007 11:54:47   

Since you are selecting fields from more than one table, then this won't be an entity, unless you are using some kind of Inheritance relations between those entities.

So you should be using a DynamicList. And you can specify the JoinHint to be an InnerJoin or an OUterJoin when you define the relation between the entities used, in the RelationCollection passed to the fetch method.

Please consult the LLBLGen Pro manual's section: "Using the generated code -> Adapter/SelfServicing -> Using TypedViews, TypedLists & Dynamic Lists -> Using dynamic lists"

Posts: 12
Joined: 30-Nov-2007
# Posted on: 30-Nov-2007 14:20:54   

OK, thanks for your help ..... !!smile