How execute a scalar query?

Posts   
 
    
xc_lw2000
User
Posts: 48
Joined: 12-Dec-2006
# Posted on: 13-Feb-2009 07:13:32   

I'm using adapter mode. How can i execute a scalar query quickly.

I find the ExecuteScalarQuery(IRetrievalQuery queryToExecute) method,but i don't know how to create the instance of IRetrievalQuery.

public RetrievalQuery( IDbCommand commandToUse ) What the IDbCommand is?SqlCommand?OledbComand or else?Can someone give me some example?

Can I do not have to pass a IDbCommand in,just pass a simple sql statement in?

Assume there is a method named GetScalar(string sql),I can execute a scalar by GetScalar("select column_name from table_name"). Is there a such method in LLBL FrameWork?This I can never consider whath the IDbCommand or IDbConnection is.

Thanks.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 13-Feb-2009 08:44:06   

Yes the method is called GetScalar() simple_smile

Please check the following documentation link: Aggregate functions in scalar queries

xc_lw2000
User
Posts: 48
Joined: 12-Dec-2006
# Posted on: 14-Feb-2009 02:14:13   

Resolved,thanks for your reply

xc_lw2000
User
Posts: 48
Joined: 12-Dec-2006
# Posted on: 14-Feb-2009 02:15:07   

Resolved,thanks for your reply

xc_lw2000
User
Posts: 48
Joined: 12-Dec-2006
# Posted on: 14-Feb-2009 02:15:32   

Walaa wrote:

Yes the method is called GetScalar() simple_smile

Please check the following documentation link: Aggregate functions in scalar queries

Resolved,thanks for your reply