HI !
On dropdown load event, I am using following select statement
select REPLACE('test test',' ',"& #160;")
which replaces blank spaces with " & #160;"
but when i populate the drop down , vb is converting "&" with "&"
Can any one explain me why is it doing so.
Here is my complete code
Protected Sub drpMunicipality_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles drpMunicipality.Load
Dim connectionString As String = globalUtil.getConnectionString()
Dim conn As New OracleConnection
Dim cmd As New OracleCommand
Dim ds1 As New DataSet
Dim adapter As New OracleDataAdapter
Dim strsql As String
conn.ConnectionString = connectionString
conn.Open()
strsql = " select REPLACE('test test',' ','& #160;') as MUN_NM from dual"
Response.Write("strsql" & strsql)
cmd = New OracleCommand(strsql, conn)
adapter.SelectCommand = cmd
adapter.Fill(ds1)
Me.drpMunicipality.DataSource = ds1.Tables(0).DefaultView
drpMunicipality.DataTextField = "MUN_NM"
drpMunicipality.DataBind()
conn.Close()
conn.Dispose()
End Sub
End Class
On dropdown load event, I am using following select statement
select REPLACE('test test',' ',"& #160;")
which replaces blank spaces with " & #160;"
but when i populate the drop down , vb is converting "&" with "&"
Can any one explain me why is it doing so.
Here is my complete code
Protected Sub drpMunicipality_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles drpMunicipality.Load
Dim connectionString As String = globalUtil.getConnectionString()
Dim conn As New OracleConnection
Dim cmd As New OracleCommand
Dim ds1 As New DataSet
Dim adapter As New OracleDataAdapter
Dim strsql As String
conn.ConnectionString = connectionString
conn.Open()
strsql = " select REPLACE('test test',' ','& #160;') as MUN_NM from dual"
Response.Write("strsql" & strsql)
cmd = New OracleCommand(strsql, conn)
adapter.SelectCommand = cmd
adapter.Fill(ds1)
Me.drpMunicipality.DataSource = ds1.Tables(0).DefaultView
drpMunicipality.DataTextField = "MUN_NM"
drpMunicipality.DataBind()
conn.Close()
conn.Dispose()
End Sub
End Class