I have a huge DataTable, and I need go by each row and validate an specific value.
Which method give me more performance, an structure of IF ELSE or SELECT CASE? (I'm focused in the method that offer me the best performance)
IF ELSE (METHOD #1)
For Each vRow In vDTtemp.Rows
If vRow("Item") = "Time" Then
vRow("Result") = "000"
ElseIf vRow("Item") = "DateTime" Then
vRow("Result") = "001"
ElseIf vRow("Item") = "String" Then
vRow("Result") = "002"
Else
vRow("Result") = "N/A"
End If
Next
SELECT CASE (METHOD #2)
For Each vRow In vDTtemp.Rows
Select Case vRow("Item")
Case "Time"
vRow("Result") = "000"
Case "DateTime"
vRow("Result") = "001"
Case "String"
vRow("Result") = "002"
Case Else
vRow("Result") = "N/A"
End Select
Next