Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> May I have code for Group by
 

Pages: 1
LLBLGen Pro Runtime Framework
May I have code for Group by
Page:1/1 

  Print all messages in this thread  
Poster Message
nopchan
User



Location:

Joined on:
30-Apr-2005 02:19:03
Posted:
56 posts
# Posted on: 12-Nov-2005 11:18:36.  
select tablegr_group from tablegr where tablegr_group <> 'N/A' group by tablegr_group

in sql server
  Top
Marcus
User



Location:
Dublin, Ireland
Joined on:
23-Apr-2004 11:49:41
Posted:
747 posts
# Posted on: 12-Nov-2005 11:22:29.  
nopchan wrote:
select tablegr_group from tablegr where tablegr_group <> 'N/A' group by tablegr_group

in sql server


Look at "Generated code - Field expressions and aggregates" in the documentation.


Blog: http://www.styledesign.biz/weblogs/macinnesm/
Website http://pix.ie
 
Top
sparmar2000
User



Location:
Aylesbury, UK
Joined on:
30-Nov-2003 14:50:22
Posted:
341 posts
# Posted on: 12-Nov-2005 20:08:42.  
Here is the example from the document

Code:
' VB.NET
Dim adapter As New DataAccessAdapter()
Dim fields As New ResultsetFields(3)
fields.DefineField(EmployeeFieldIndex.FirstName, 0, "FirstNameManager", "Manager")
fields.DefineField(EmployeeFieldIndex.LastName, 1, "LastNameManager", "Manager")
fields.DefineField(EmployeeFieldIndex.LastName, 2, "AmountEmployees", "Employee", AggregateFunction.Count)
Dim bucket As IRelationPredicateBucket = New RelationPredicateBucket()
bucket.Relations.Add(EmployeeEntity.Relations.EmployeeEntityUsingEmployeeId, "Employee", "Manager", JoinHint.None)

Dim groupByClause As IGroupByCollection = New GroupByCollection()
groupByClause.Add(fields(0))
groupByClause.Add(fields(1))

Dim dynamicList As New DataTable()
Dim dao As New TypedListDAO()
adapter.FetchTypedList(fields, dynamicList, bucket, 0, Nothing, True, groupByClause)
  Top
nopchan
User



Location:

Joined on:
30-Apr-2005 02:19:03
Posted:
56 posts
# Posted on: 14-Nov-2005 17:27:43.  
sparmar2000 wrote:
Here is the example from the document

Code:
' VB.NET
Dim adapter As New DataAccessAdapter()
Dim fields As New ResultsetFields(3)
fields.DefineField(EmployeeFieldIndex.FirstName, 0, "FirstNameManager", "Manager")
fields.DefineField(EmployeeFieldIndex.LastName, 1, "LastNameManager", "Manager")
fields.DefineField(EmployeeFieldIndex.LastName, 2, "AmountEmployees", "Employee", AggregateFunction.Count)
Dim bucket As IRelationPredicateBucket = New RelationPredicateBucket()
bucket.Relations.Add(EmployeeEntity.Relations.EmployeeEntityUsingEmployeeId, "Employee", "Manager", JoinHint.None)

Dim groupByClause As IGroupByCollection = New GroupByCollection()
groupByClause.Add(fields(0))
groupByClause.Add(fields(1))

Dim dynamicList As New DataTable()
Dim dao As New TypedListDAO()
adapter.FetchTypedList(fields, dynamicList, bucket, 0, Nothing, True, groupByClause)


I don't understand

fields.DefineField(EmployeeFieldIndex.FirstName, 0, "FirstNameManager", "Manager")
fields.DefineField(EmployeeFieldIndex.LastName, 1, "LastNameManager", "Manager")
fields.DefineField(EmployeeFieldIndex.LastName, 2, "AmountEmployees", "Employee", AggregateFunction.Count)

I want to group by only one field


  Top
Kris
User



Location:
the Netherlands
Joined on:
27-Oct-2005 20:48:11
Posted:
79 posts
# Posted on: 14-Nov-2005 17:39:47.  
Dim groupByClause As IGroupByCollection = New GroupByCollection()
groupByClause.Add(fields(0))
groupByClause.Add(fields(1))


You can define yourself to gorupby one fiels or multiple fields.

 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.