I am passing an array to a function which converts the array to an XML. But I am not able to use special characters like "<"
or "&"
. When I pass these it gives error invalid XML file.
Protected Sub drawgraph(ByRef dt As DataTable, ByVal name As String)
Try
Dim n(dt.Columns.Count - 3) As String
Dim r(dt.Columns.Count - 3) As String
For i As Integer = 1 To dt.Columns.Count - 2
***n(i - 1) = dt.Columns(i).ColumnName.ToString.Replace("<", "<")***
r(i - 1) = (dt.Rows(0).Item(i))
Next
ChartBuilder1.BuildLabel(n)
ChartBuilder1.BuildValues(r, "Age Profile")
ChartBuilder1.GenerateGraph()
ChartBuilder1.Visible = True
Catch ex As Exception
lbl_msg.Text = ex.Message
End Try
End Sub
I am replacing "<"
with "<"
but it is not working