Technology and Online Community For All
welcome JOIN US NOW AND FEEL THE DIFFERENCE headbang
Technology and Online Community For All
welcome JOIN US NOW AND FEEL THE DIFFERENCE headbang
Technology and Online Community For All
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Technology and Online Community For All

What You See Is What You Get
 
HomeGalleryLatest imagesSearchRegisterLog in
March 2024
SunMonTueWedThuFriSat
     12
3456789
10111213141516
17181920212223
24252627282930
31      
CalendarCalendar
Latest topics
» Uniblue PowerSuite
TUT Calculate Value Field of DataBase Icon_minitimeMon Apr 09, 2012 7:27 pm by BlitzKrieG

» Ova Drive Hider
TUT Calculate Value Field of DataBase Icon_minitimeFri Mar 02, 2012 8:48 am by CodeWarrior

» Ova Folder Security
TUT Calculate Value Field of DataBase Icon_minitimeMon Feb 27, 2012 5:06 pm by CodeWarrior

» SPSBox
TUT Calculate Value Field of DataBase Icon_minitimeSun Feb 26, 2012 4:24 am by CodeWarrior

» Norton [all here]
TUT Calculate Value Field of DataBase Icon_minitimeThu Feb 23, 2012 8:01 am by BlitzKrieG

» OvaSystemSolution CVRS System
TUT Calculate Value Field of DataBase Icon_minitimeSat Feb 18, 2012 6:06 am by CodeWarrior

» Avril Lavigne - Smile
TUT Calculate Value Field of DataBase Icon_minitimeSat Jan 28, 2012 7:14 am by ^PiNKHeRMioNe

» Hot N Cold- Katy Perry
TUT Calculate Value Field of DataBase Icon_minitimeSat Jan 28, 2012 7:11 am by ^PiNKHeRMioNe

» America's next top model (All Stars) Lisa D'Amato
TUT Calculate Value Field of DataBase Icon_minitimeSat Jan 28, 2012 6:55 am by ^PiNKHeRMioNe

Search
 
 

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

None

Most users ever online was 265 on Wed Sep 22, 2021 9:02 pm
Top posters
trekyboy
TUT Calculate Value Field of DataBase Vote_lcap2TUT Calculate Value Field of DataBase Voting_bar2TUT Calculate Value Field of DataBase Vote_rcap2 
BlitzKrieG
TUT Calculate Value Field of DataBase Vote_lcap2TUT Calculate Value Field of DataBase Voting_bar2TUT Calculate Value Field of DataBase Vote_rcap2 
ZNABiRA
TUT Calculate Value Field of DataBase Vote_lcap2TUT Calculate Value Field of DataBase Voting_bar2TUT Calculate Value Field of DataBase Vote_rcap2 
EDI`STEALTH
TUT Calculate Value Field of DataBase Vote_lcap2TUT Calculate Value Field of DataBase Voting_bar2TUT Calculate Value Field of DataBase Vote_rcap2 
*B o R g Z
TUT Calculate Value Field of DataBase Vote_lcap2TUT Calculate Value Field of DataBase Voting_bar2TUT Calculate Value Field of DataBase Vote_rcap2 
SHY
TUT Calculate Value Field of DataBase Vote_lcap2TUT Calculate Value Field of DataBase Voting_bar2TUT Calculate Value Field of DataBase Vote_rcap2 
CodeWarrior
TUT Calculate Value Field of DataBase Vote_lcap2TUT Calculate Value Field of DataBase Voting_bar2TUT Calculate Value Field of DataBase Vote_rcap2 
^PiNKHeRMioNe
TUT Calculate Value Field of DataBase Vote_lcap2TUT Calculate Value Field of DataBase Voting_bar2TUT Calculate Value Field of DataBase Vote_rcap2 
RaiJin
TUT Calculate Value Field of DataBase Vote_lcap2TUT Calculate Value Field of DataBase Voting_bar2TUT Calculate Value Field of DataBase Vote_rcap2 
chaotic`
TUT Calculate Value Field of DataBase Vote_lcap2TUT Calculate Value Field of DataBase Voting_bar2TUT Calculate Value Field of DataBase Vote_rcap2 
Statistics
We have 239 registered users
The newest registered user is Hellraiser666

Our users have posted a total of 948 messages in 662 subjects

 

 TUT Calculate Value Field of DataBase

Go down 
AuthorMessage
CodeWarrior
Code Master
Code Master
avatar


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

TUT Calculate Value Field of DataBase Empty
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
Share this post on: reddit

TUT Calculate Value Field of DataBase :: Comments

No Comment.
 

TUT Calculate Value Field of DataBase

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-
Jump to: