hi ..
I tried to add a links ,html link, in ArrayList in vb, then I retrieved that links to display it in label. Like this:
but i have a problem when i add vb variable "NewID" to html href , cuz its return nothing !
Although the "newsContent " is wirked well.
i don't know if it is a correct format !
or if there is any other way to add link in ArrayList.
thanx
I tried to add a links ,html link, in ArrayList in vb, then I retrieved that links to display it in label. Like this:
VB.NET:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'initilize connection string
con.ConnectionString = ConfigurationManager.ConnectionStrings("DalilucDBConnectionString").ConnectionString
'select maximum news id to display latest news
sql = String.Format("select news_id, contents from news ")
'Create Command object
thisCommand = New SqlCommand(sql, con)
'Open connection
con.Open()
'Execute query
Dim thisReader As SqlDataReader = thisCommand.ExecuteReader
thisCommand.Dispose()
While thisReader.Read
newsID = Convert.ToString(thisReader.GetValue(0))
newsContent = Convert.ToString(thisReader.GetValue(1))
contentAry.Add("<a ' href = 'NewsDetails.aspx?' " & newsID & " >" & newsContent & "</a>")
End While
but i have a problem when i add vb variable "NewID" to html href , cuz its return nothing !
Although the "newsContent " is wirked well.
i don't know if it is a correct format !
or if there is any other way to add link in ArrayList.
thanx
Last edited: