I save a big set of data where each record has a time-mark. I wanna save each item also with UTC time-mark so I convert the original time with use of ToUniversalTime() (VB.NET). The use of this method appears to be quite slow. Do you have any tips how to accelerate the process?
For Each i In CollectionOutput.Select(Function(f) f)
Dim utcTimeMark = i.GetTIMEMARK.ToUniversalTime()
contextEmanagement.pr_Collection_Store(i.GetID, i.GetTIMEMARK, utcTimeMark, i.GetVALUE)
Next
Where .pr_Collection_Store calls SQL Server stored procedure.
Currently your stored procedure presumably does something like this (I am absolutely guessing at data types here, and I’m assuming you are using SQL Server 2008 or better – please specify your version when asking questions!):
You could do this instead:
Then from the app. Sorry, I know C#, hopefully you can translate this to VB.NET.