PC Review


Reply
Thread Tools Rate Thread

datatable.compute

 
 
Chuck Hecht
Guest
Posts: n/a
 
      27th Aug 2007
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."}



 
Reply With Quote
 
 
 
 
Patrick Steele
Guest
Posts: n/a
 
      28th Aug 2007
In article <#(E-Mail Removed)>,
(E-Mail Removed) 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 ((E-Mail Removed))
http://weblogs.asp.net/psteele
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
datatable.compute and CurrentRows Brian Yuill Microsoft VB .NET 1 12th Mar 2008 02:32 PM
DataTable.Compute() question SpaceMarine Microsoft ADO .NET 5 22nd Aug 2007 08:41 AM
DataTable Compute Method =?Utf-8?B?QW5kcmVpd2lk?= Microsoft ADO .NET 1 8th Nov 2005 07:01 PM
datatable.compute method =?Utf-8?B?RGF2aWQgQW5kZXJzb24=?= Microsoft Dot NET 1 8th Jun 2005 11:16 AM
Datatable.Compute and Sorting scorpion53061 Microsoft ADO .NET 4 10th May 2004 06:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:18 PM.