In addition to Cetins hints, keep in mind that you are constantly re-reading a single value unnecessarily. In your scenraio you should store the value oRow["SomeField"] to a typed value then assign that.
Maybe not a big deal in this scenario since you're not looping, but in other scenerios you definitely don't want to call the row repeatedly as type conversion occurs on every single one of those row accesses.
When in a loop too it's often better to use a TableColumn as an index instead of a string. I've seen situations where using strings is 10 times slower than the TableColumn itself which is the natively stored hashvalue.
+++ Rick ---
>I just found something that I just can't find the reason. I have a terrible slowdown in one of my .NET application.
>
>If I have this:
>
>
> If cCurrentField = "No_Claim" Then
> lcHtml = lcHtml + "&ClaimNo=" + Trim(oRow("No_Claim")) + "&MitTelAI=" + _
> LTrim(Str(oRow("AI"))) + "&Hd=1>"
> End If
>
>
>as part of a loop which is executed 200 times, it will take one second to execute the loop 200 times.
>
>But, if I have this:
>
>
> If cCurrentField = "No_Claim" Then
> lcHtml = lcHtml + "&ClaimNo=" + Trim(oRow("No_Claim")) + "&MitTelAI=" + _
> LTrim(Str(oRow("AI"))) + "&Hd=1>" + "&ClaimNo=" + Trim(oRow("No_Claim")) + "&MitTelAI=" + _
> LTrim(Str(oRow("AI"))) + "&Hd=1>" + "&ClaimNo=" + Trim(oRow("No_Claim")) + "&MitTelAI=" + _
> LTrim(Str(oRow("AI"))) + "&Hd=1>" + "&ClaimNo=" + Trim(oRow("No_Claim")) + "&MitTelAI=" + _
> LTrim(Str(oRow("AI"))) + "&Hd=1>" + "&ClaimNo=" + Trim(oRow("No_Claim")) + "&MitTelAI=" + _
> LTrim(Str(oRow("AI"))) + "&Hd=1>" + "&ClaimNo=" + Trim(oRow("No_Claim")) + "&MitTelAI=" + _
> LTrim(Str(oRow("AI"))) + "&Hd=1>" + "&ClaimNo=" + Trim(oRow("No_Claim")) + "&MitTelAI=" + _
> LTrim(Str(oRow("AI"))) + "&Hd=1>" + "&ClaimNo=" + Trim(oRow("No_Claim")) + "&MitTelAI=" + _
> LTrim(Str(oRow("AI"))) + "&Hd=1>"
> End If
>
>
>as part of a loop which is executed 200 times, it will take 7 seconds to execute the loop 200 times.
>
>What is going on? Why is it that simply adding a longer string causes the process to crawl?