Technology and Online Community For All
welcome JOIN US NOW AND FEEL THE DIFFERENCE headbang

Technology and Online Community For All

What You See Is What You Get
 
HomeCalendarGalleryFAQSearchMemberlistUsergroupsRegisterLog in
May 2013
SunMonTueWedThuFriSat
   1234
567891011
12131415161718
19202122232425
262728293031 
CalendarCalendar
Latest topics
» Uniblue PowerSuite
Tue Apr 10, 2012 12:27 am by BlitzKrieG

» Ova Drive Hider
Fri Mar 02, 2012 1:48 pm by CodeWarrior

» Ova Folder Security
Mon Feb 27, 2012 10:06 pm by CodeWarrior

» SPSBox
Sun Feb 26, 2012 9:24 am by CodeWarrior

» Norton [all here]
Thu Feb 23, 2012 1:01 pm by BlitzKrieG

» OvaSystemSolution CVRS System
Sat Feb 18, 2012 11:06 am by CodeWarrior

» Avril Lavigne - Smile
Sat Jan 28, 2012 12:14 pm by ^PiNKHeRMioNe

» Hot N Cold- Katy Perry
Sat Jan 28, 2012 12:11 pm by ^PiNKHeRMioNe

» America's next top model (All Stars) Lisa D'Amato
Sat Jan 28, 2012 11:55 am by ^PiNKHeRMioNe

Search
 
 

Display results as :
 
Rechercher Advanced Search
Who is online?
In total there are 3 users online :: 0 Registered, 0 Hidden and 3 Guests

None

Most users ever online was 16 on Wed Apr 18, 2012 7:39 pm
Top posters
trekyboy
 
BlitzKrieG
 
ZNABiRA
 
EDI`STEALTH
 
*B o R g Z
 
SHY
 
CodeWarrior
 
^PiNKHeRMioNe
 
RaiJin
 
chaotic`
 
Similar topics
  • » FCC FIELD NOTICES
  • » New 3CD Tommy Bolin features Outakes and Billy Cobham
  • » I hate mindless data entry
  • » What is the value of your Metal CDs? - Online Metal CDs Price guide
  • » 1987.08.26 - Edmonton Convention Centre, Edmonton, Canada
  • » Football/Soccer/Futsal @Tampines Safra
  • » Tell us about your home town
  • » [ASK] Cara daftar squad di database IR
  • Statistics
    We have 129 registered users
    The newest registered user is arewal

    Our users have posted a total of 949 messages in 663 subjects
    Share | 
     

     TUT Calculate Value Field of DataBase

    View previous topic View next topic Go down 
    AuthorMessage
    CodeWarrior
    Code Master
    Code Master


    Join date: 2011-12-21
    Male Posts: 22

    20120102
    PostTUT Calculate Value Field of DataBase

    Sample you have an database with field name of Total

    For Database get value of total sum for the cell
    The "TotalAmount" is my Database Field

    Code:

    Private Sub btnTotal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTotal.Click

            Try
                Dim totalSum As Integer

                For i As Integer = 0 To ds.Tables(0).Rows.Count - 1
                    totalSum += ds.Tables(0).Rows(i).Item("TotalAmount")
                Next

                Label1.Text = "Total : " & totalSum.ToString()
            Catch ex As Exception
                MsgBox(ex.ToString)
            End Try
         
        End Sub


    Sample
    Juan Jan 230, Juan Mar 150, Juan Aug 320
    Pedro Jan 120, Pedro Dec 380

    For Individual contribute of person to display the total contribute
    just type the name to textbox then click the button

    Code:

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            Dim Total As Integer = 0
            For i As Integer = 0 To DataGridView1.RowCount - 1
                If DataGridView1.Rows(i).Cells(1).Value = TextBox1.Text Then
                    Total += DataGridView1.Rows(i).Cells(2).Value
                End If
            Next
            If Total = 0 Then
                MessageBox.Show("No Records Found")
            End If
            Label1.Text = Total
        End Sub
    Back to top Go down
    View user profile

     Similar topics

    -
    » Simfile Database
    » Luxembourg - Rock -A-Field
    » London show 1972
    » Stooges St Louis 70/71 photos
    » 2011.12.08 - Conseco Field House, Indianapolis, USA
    Share this post on: Excite BookmarksDiggRedditDel.icio.usGoogleLiveSlashdotNetscapeTechnoratiStumbleUponNewsvineFurlYahooSmarking

    TUT Calculate Value Field of DataBase :: Comments

    No Comment.
     

    TUT Calculate Value Field of DataBase

    View previous topic View next topic Back to top 

    Page 1 of 1

    Permissions in this forum:You cannot reply to topics in this forum
    Technology and Online Community For All :: Technical Support :: Programming Related :: Visual Basic 6/VB.NET-