Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / August 2007

Tip: Looking for answers? Try searching our database.

datatable.compute

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chuck Hecht - 27 Aug 2007 22:32 GMT
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."}
Patrick Steele - 28 Aug 2007 03:45 GMT
> Hello
>
[quoted text clipped - 17 lines]
> 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

Signature

Patrick Steele (patrick@mvps.org)
http://weblogs.asp.net/psteele


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.