User-1546380551 posted
Hi,
I have a table with a few colums and the test data is 500 rows in which I am trying to create a string of 'a' records in a string builder, which is working fine but the number of 'a' records are duplicated more than twice, which doesn't make sense. If I
check the number of rows it reads correctly so I am unsure how come these items are duplicated.
I am just using the usual code anyone would use:
Dim sb As StringBuilder = New StringBuilder
Dim strTemp As String = String.Empty
For i As Integer = 0 To ds.Tables(strTable).Rows.Count
strTemp += "My Code Here To Create The 'a' tag"
' URL (href), Link Text (title), Link Text (clickable text)
strTemp += ds.Tables(strTable).Rows(i).Item(2) bla bla ds.Tables(strTable).Rows(i).Item(1) bla bla ds.Tables(strTable).Rows(i).Item(1)
sb.Append(strTemp)
Next
Database Table Colums:
1) An Integer
2) Link Text
3) URL
4) Not Important
The StringBuilder outputs the finished string like so: Link 1, Link 1, Link 2, Link 2... Link 1, Link 1, Link 2, Link 2 rather than Link 1, Link 2, Link 3 and so on. That's what doesn't make sense. Why is it duplicating?
Have searched Google so not interested in links. This is a VB.NET forum so not interested in C#, C++, F# and so on.
Any ideas?