StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Performing a GROUP BY on a DataTable/BO...Expand / Collapse
Author
Message
Posted 08/25/2006 9:58:42 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
I have a BO that is filled with data that could contain more than one division. How can I perform an aggregate function on this BO/DataTable to determine if I have more than one type of division? For example

ID Division
1 A
2 A
3 B

I was wondering if there was a way to do this without making a trip to the database... whether it be a .NET way or a StrataFrame way.

Thanks.
Post #2471
Posted 08/25/2006 1:38:26 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
Guys? Anybody?

Would it just be easier to execute a stored procedure and create a data reader to get my result?
Post #2479
Posted 08/25/2006 2:03:19 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 10/21/2008 9:20:58 AM
Posts: 2,685, Visits: 1,887
You can do a DataTable.Select on the CurrentDataTable of the business object and select the rows that contain each of the 3 divisions.  The method will return a DataRow array that contains the count of the records that match the given select, but that requires that you test each division type and then check the length of the returned array.  DataTables cannot do any sort of complex or aggregate functions, so if it's too complex, you'll have to do it through the database.


www.bungie.net
Post #2481
Posted 08/25/2006 2:09:31 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
Thanks.
Post #2482
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 6:17am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 12 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.