Friends, I have a field with tags, I want to replace the id of the tags with the name of the value from a database, how can I replace all the values of the tags?
Table relation (Values)
TextField.Text = “</1/></2/>”
TextField.Text = “Red, Blank”
This code is for illustration purposes only, and should be modified by the developer to fit their particular circumstance
Dave’s example if where the tags are in a single record. In your case, you’d loop through the RecordSet and replace each “/#/” with the value of that record. I’m unclear if the placeholders correspond to record ID’s, as it appears, or merely counters.
dim rs as RecordSet = db.SQLSelect( "SELECT * FROM values" )
dim s as string = TextField.Text
while not rs.EOF
dim id as integer = rs.Field( "ID" ).IntegerValue
dim name as string = rs.Field( "Name" ).StringValue
s = s.ReplaceAll( "/" + str( id ) + "/", name )
TextField.Text = s
What he said.