Hi All!
I Have this code, for a method called: PopulateListBox:
If rs Is Nil Then Return
// set up listbox state for population
dataList.DeleteAllRows
dataList.Columncount = rs.Fieldcount
// Add the DB columns as the headers for the ListBox
datalist.HasHeading = True
dataList.ColumnCount = rs.FieldCount
dataList.Column(-1).WidthExpression = “100”
For i As Integer = 0 To rs.FieldCount-1
dataList.Heading(i) = rs.IdxField(i+1).Name
Next
// Add the data from the table
While Not rs.EOF
dataList.AddRow("")
For i As Integer = 0 To rs.FieldCount-1
dataList.Cell(dataList.LastIndex, i) = rs.IdxField(i+1).StringValue
Next
rs.MoveNext
Wend
Now I have an Issue, How can I replace a character in the Name of the Headers?
So, This is the names of my headers on the Database:
XML, Emmiter-Name, RFC-Emitter-Name, TAX-Rate, TAX-Rate-11.
With the Code This name are display in the headers in the listbox.
But I want to know How can I replace the “-” character with " " space character.
In order to display the headers on the listbox like this:
XML, Emmiter Name, RFC Emitter Name, TAX Rate, TAX Rate-11.
I’m thinking on the loop:
For i As Integer = 0 To rs.FieldCount-1
dataList.Heading(i) = rs.IdxField(i+1).Name
Next
I dunno if there’s a way to process the rs.IdxField(x).name,to behave like: If rs.IdxField(i+1).Name have “-” then replace with " ".
Is this posible? How?
Thanks