Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rounding without decimal
Message
From
04/03/2011 09:46:38
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01502535
Message ID:
01502651
Views:
26
>Resolving loRow repeatedly in that last line looks a bit slow. Why not:
Dim rows as DataRowCollection = oDataProvider.oDataSet.Tables("Temp").Rows
>For lnCounter2 = lnStart To lnMax - 1
>       loRow = rows(lnCounter2)
Come to that why not allow a flexible batch size.Something like:
Public Sub ProcessAll(ByVal lnBatchSize As Integer)
>        Dim i As Integer = 0
>        Dim lnCount As Integer = oDataSet.Tables("Temp").Rows.Count
>        While i < lnCount - lnBatchSize
>            ProcessBatch(i, i + lnBatchSize - 1)
>            i += lnBatchSize
>        End While
>        ProcessBatch(i, lnCount)
>    End Sub
>    Public Sub ProcessBatch(ByVal first As Integer, ByVal last As Integer)
>        Dim loRow As DataRow
>        Dim rows As DataRowCollection = oDataSet.Tables("Temp").Rows
>        For lnCounter2 As Integer = first To last
>            loRow = rows(lnCounter2)
>        Next
>    End Sub
For its use so far, it was not an impact. But, doing it on a large scale dataset, then, the idea sounds good. I will have to check it out. Thanks for the info.

The idea about allowing the class to exposure a property for the number of items to be processed in the batch sounds good. I will make it to default to 1000.

Thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform