I want to get the total sum of the amount column. How can I display the total sum to the textbox total? Any possible way to do it? Please help. Thanks!
Ann95 0 Newbie Poster
Recommended Answers
Jump to PostTry :
Dim temp As Long = 0 For i = 0 To DataGridView1.Rows.Count - 1 temp = temp + DataGridView1.Item(6, i).Value 'Column 6 is Amount Next Total.Text = temp
Jump to Postthe datagrid is bound
You can use SUM function to get total amount.
select sum(amount) as TotalAmount from TableName
All 7 Replies
renzlo 4 Junior Poster in Training
Jx_Man 987 Nearly a Senior Poster Featured Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Ann95 0 Newbie Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster
Abu Ehab 0 Newbie Poster
Ann95 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.