Hi Giles,
Welcome to ADO.net newsgroup.
As for the problem on use DataTable's filter functions (compute or Select
methods...) with Guid column, it is actually due to the DataTable's sql
expression engine only support some basic types such as numeric , string
text .... As for Guid, the DataTable's build-in filtering engine can not
support those sql experssion on Guid type column. Currently based on my
testing, one possible means is to use a string type column which contains
the Guid's string text (through Guid.ToString()), we can perform normal
sql filtering operations on string type columns correctly... So I'm not
sure whether using a string column in your DataTable instead of the Guid
column is possible, if not (e.g your datatable is filled by DataAccessing
from backend database...), we may need to implement our own function which
loop the DataTable rows to find the unique row....
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: dataTable.Compute("Count(GuidCol)", "") generates Exception
| thread-index: AcX5B5WxUTxhEULOTXO/wcNtk6nyjA==
| X-WBNR-Posting-Host: 80.3.160.7
| From: =?Utf-8?B?R2lsZXNU?= <(E-Mail Removed)>
| Subject: dataTable.Compute("Count(GuidCol)", "") generates Exception
| Date: Sun, 4 Dec 2005 11:19:02 -0800
| Lines: 40
| Message-ID: <5F0564BE-03E2-47E3-8440-(E-Mail Removed)>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.adonet:117211
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Hi,
|
| I have a datatable that has three columns each of data type Guid. (which
I
| have just changed from previously being Integers)
|
| In the past I have used :
|
| dataTable.Compute("Count(Col1)", "Col1=5") - which worked fine
|
| Now having changed the data types to Guids I get an exception when I use:
|
| dataTable.Compute("Count(Col1)",
| "Col1='00000000-0000-0000-0001-000000000032'")
|
| (also generates exception for:
|
| dataTable.Compute("Count(Col1)", "") - so the problem is not with the
| filter expression.
|
| The error is:
| Message="Invalid usage of aggregate function Count() and Type: Guid."
| Source="System.Data"
|
| Does anyone know how to get this working please?
|
| thanks,
|
| Giles
|
|
|
|
|
|
|
| generates Exception
|
| I would like to use th
|
| Invalid usage of aggregate function Count() and Type: Guid.
|