V
Vayse
I have a Datatable, dtCustomers. It has several fields. I need to loop
through it, passing only the Customer Code to another function. Function
name is CalcVat.
Does looping through rows have a memory overhead? As in, which is better:
Method A)
For each rowCustomer in dtCustomers.Rows
CalcVat(rowCustomer("CustCode")
Next
Method B)
Dim iLoop as Integer
For iLoop = 0 to dtCustomers.Rows.Count
CalcVat(iLoop).Item("CustCode")
Next
Normally, I use Method A, just want to know which is the most efficient.
Thanks
Vayse
through it, passing only the Customer Code to another function. Function
name is CalcVat.
Does looping through rows have a memory overhead? As in, which is better:
Method A)
For each rowCustomer in dtCustomers.Rows
CalcVat(rowCustomer("CustCode")
Next
Method B)
Dim iLoop as Integer
For iLoop = 0 to dtCustomers.Rows.Count
CalcVat(iLoop).Item("CustCode")
Next
Normally, I use Method A, just want to know which is the most efficient.
Thanks
Vayse