Last post Jun 04, 2014 06:18 PM by crouchie2004
Jun 04, 2014 06:05 PM|crouchie2004|LINK
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)
Database Table Colums:
1) An Integer
2) Link Text
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.
Jun 04, 2014 06:15 PM|AidyF|LINK
strTemp += "My Code Here To Create The 'a' tag"
strTemp = "My Code Here To Create The 'a' tag"
Jun 04, 2014 06:18 PM|crouchie2004|LINK
I am so shattered I never saw that I still had that in there from something earlier - cheers