5 Replies - 6010 Views - Last Post: 24 September 2008 - 03:50 AM Rate Topic: -----

#1 budoor143  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-September 08

Calculate account balance

Posted 22 September 2008 - 01:21 AM

Hello ..
How are you everybody..

I write this code for my datagrid but didn't calculate the balance for me

any body can fix the code ..
 
Private Sub TransactionsDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles TransactionsDataGridView.CellContentClick 'Dim Debit As Double = 0.0

	  Dim debit As Double

		Dim Credit As Double

		Dim balance As Double

		For Each rows As DataGridViewRow In TransactionsDataGridView.Rows

			For x As Integer = 0 To TransactionsDataGridView.Rows.Count - 2

				If Not TypeOf TransactionsDataGridView.Rows(x).Cells(6).Value Is DBNull Then

					debit = TransactionsDataGridView.Rows(x).Cells(6).Value

				End If

				If Not TypeOf TransactionsDataGridView.Rows(x).Cells(7).Value Is DBNull Then

					Credit = TransactionsDataGridView.Rows(x).Cells(7).Value

				End If
				balance = TextBox1.Text
				balance = balance + Credit - Debit
				balance = TransactionsDataGridView.Rows(x).Cells(8).Value


			Next
		Next

	End Sub
End Class


I'm using vb 2005 but not .net

Attached image(s)

  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: Calculate account balance

#2 AdamSpeight2008  Icon User is online

  • MrCupOfT
  • member icon


Reputation: 2240
  • View blog
  • Posts: 9,412
  • Joined: 29-May 08

Re: Calculate account balance

Posted 22 September 2008 - 05:32 AM

View Postbudoor143, on 22 Sep, 2008 - 09:21 AM, said:

Hello ..
How are you everybody..

I write this code for my datagrid but didn't calculate the balance for me

any body can fix the code ..
 
Private Sub TransactionsDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles TransactionsDataGridView.CellContentClick 'Dim Debit As Double = 0.0

	  Dim debit As Double

		Dim Credit As Double

		Dim balance As Double

		For Each rows As DataGridViewRow In TransactionsDataGridView.Rows

			For x As Integer = 0 To TransactionsDataGridView.Rows.Count - 2

				If Not TypeOf TransactionsDataGridView.Rows(x).Cells(6).Value Is DBNull Then

					debit = TransactionsDataGridView.Rows(x).Cells(6).Value

				End If

				If Not TypeOf TransactionsDataGridView.Rows(x).Cells(7).Value Is DBNull Then

					Credit = TransactionsDataGridView.Rows(x).Cells(7).Value

				End If
				balance = TextBox1.Text
				balance = balance + Credit - Debit
				balance = TransactionsDataGridView.Rows(x).Cells(8).Value


			Next
		Next

	End Sub
End Class


I'm using vb 2005 but not .net


VB2005 is a .Net Language.
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1638
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Calculate account balance

Posted 22 September 2008 - 10:55 AM

Moved to VB.NET :)
Was This Post Helpful? 0
  • +
  • -

#4 budoor143  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-September 08

Re: Calculate account balance

Posted 23 September 2008 - 02:47 AM

I'm using microsoft visual studio 2005 but my program not for the web site, i don't know how explain :wub:
Was This Post Helpful? 0
  • +
  • -

#5 AdamSpeight2008  Icon User is online

  • MrCupOfT
  • member icon


Reputation: 2240
  • View blog
  • Posts: 9,412
  • Joined: 29-May 08

Re: Calculate account balance

Posted 24 September 2008 - 02:39 AM

View Postbudoor143, on 23 Sep, 2008 - 10:47 AM, said:

I'm using microsoft visual studio 2005 but my program not for the web site, i don't know how explain :wub:


The .Net doesn't meaning its for the Internet, it is a framework which applications (programs) can based on.
Wikipedia entry about .Net
Was This Post Helpful? 0
  • +
  • -

#6 budoor143  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-September 08

Re: Calculate account balance

Posted 24 September 2008 - 03:50 AM

AdamSpeight2008'

thank you, i read about .Net

any one can help me in my code
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1