Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8247105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:43:54+00:00 2026-06-07T22:43:54+00:00

I am developing a program for a chain of restaurants, they should normally be

  • 0

I am developing a program for a chain of restaurants, they should normally be able to calculate their guestcount and sales through a vb.net application with a connection to dbf files.
My dataset gets filled in correctly as is my datatable (checked by filling in datarowview = right data)
But then I get a problem, in all my functions using my datatable, the datatable skips the final value, in this case it is all values from a month so it either skips 31 or day 30.
Tried while, Tried for each, debugged alot (how i found it was the last value). But now I have no idea why the last value isn’t used by the function

    Public Function Getgctakeout(ByVal i_table As DataTable)
       table = i_table
       i = 0
       gctakeout = 0

    For Each row As DataRow In i_table.Rows

        gctakeout = gctakeout + Convert.ToDouble(row(4))

    Next row
        'MessageBox.Show(gctakeout)
    Return gctakeout
    End Function

This function does not use the value of the last row to calculate gctakeout

what in the name of the lord is wrong 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T22:43:56+00:00Added an answer on June 7, 2026 at 10:43 pm

    Assuming that your DataTable is really filled correctly, you have two other options to get the sum.

    1. Use the old DataTable.Compute method which works also with .NET < 2.0
    2. Use Linq-To-DatSet and it’s Enumerable.Sum

    1)

    Dim Sum = CType(table.Compute("Sum(ColumnName)", Nothing), Double)
    

    2)

    Dim Sum = table.AsEnumerable().
                    Sum(Function(row)row.Field(Of Double)("ColumnName"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a program in C# .NET 4, my program is kind of
I am developing a program in VB.NET. I have an enum called PriceType that
I am developing a program that will be run through Windows remote desktop, and
I'm developing automation program using winforms webbrowser control. I am able to get the
first question here. I'm developing a program in C# (.NET 3.5) that displays files
I am developing a program (in .Net) that has a lot of image processing
I'm new in Java. I'm developing program for Android similar to app for iOS.
I am developing a program that will bootstrap another program, so as a result
I am currently developing a program that uses C#'s Dictionary container (specifically, SortedDictionary). This
I am developing a program where I find myself doing this like this a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.