DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Fri, 17 Aug 2007 16:04:18 -0700,    posted on: microsoft.public.dotnet.framework        back       

Thread Index
  1    SpaceMarine


DataTable.Compute() question   
hello,

i have a big datable of a bunch of stuff. i am interested in getting
row counts that match certain criteria.

currently i do this by creating a new DataView for each criteria, and
getting its .RowCount. like so:

	dv = New DataView(dt, "Type = 2", "Type",
DataViewRowState.CurrentRows)
	total = dv.Count
	writer.WriteLine(String.Format("Lines of Type 2: {0}.", total))

....that works, but i was wondering -- is there a way to use the
DataTable.Compute() method to do this? i had tried something like
this, but it didnt work:

	Dim oTotal As Object = dt.Compute("Count(*)", "Type = 2")

....this doesnt work because the aggregate function Count() isnt
designed to work this way. but is there something that is?

thanks!
matt
Date:Fri, 17 Aug 2007 16:04:18 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us