Re: datatable.compute
- From: Patrick Steele <patrick@xxxxxxxx>
- Date: Mon, 27 Aug 2007 22:45:15 -0400
In article <#5gMpEP6HHA.5096@xxxxxxxxxxxxxxxxxxxx>,
checht@xxxxxxxxxxxxxxxxx says...
Hello
I am getting a Syntax error in the compute method of a datatable. I want to
SUM the qty field based on a
filter expression and the expression contains 3 fields. Non of the MSDN
documentation nor any other
references tell me I can not do this.
dim str as string =""
str = "item_num =" & "'" & gitem_num & "' + " & "lot_num =" & "'" & gLot_num
& "' + " & "lot_ext =" & "'" & gLot_ext & "'"
TotalPickQty = Convert.ToInt32(dtreceivepdai.Compute("SUM(qty)", str))
{System.Data.SyntaxErrorException}
System.Data.SyntaxErrorException: {"Syntax error: Missing operand after
'5106030' operator."}
Are you sure your "str" (row filter) is correct? Try creating a
DataView with that RowFilter and see if you get any errors:
Dim dv as DataView = New DataView(dtreceivepdai)
dv.RowFilter = str
--
Patrick Steele (patrick@xxxxxxxx)
http://weblogs.asp.net/psteele
.
- References:
- datatable.compute
- From: Chuck Hecht
- datatable.compute
- Prev by Date: datatable.compute
- Next by Date: Windows mobile Speech SDK
- Previous by thread: datatable.compute
- Next by thread: Windows mobile Speech SDK
- Index(es):
Relevant Pages
|