Dear I had static news scroller one liner which works fine and now i want to make it dynamic so that I have that code before
Welcome to RBME Section!
First draft of R&D protocols
APPR PROCESS initiated
CSP4 Core team constituted
FIRST MER Network meeting is begin conducted
IT Services You Desire Always waiting for you with Plan Pakistan (ITechsol.org)
it works fine static content displays one by one now i want to make it dynamic so i placed a datalist inside my li and change the code as below
RepeatLayout="Table">
I also tried using code behind technique which is given below
Private Sub getEventImage()
Dim cnnResource As New SqlConnection(AppSettings("DbSqlPortal"))
' Dim lbl As Label = DirectCast(DataList1.FindControl("EventDescriptionLabel"), Label)
Dim _da As SqlDataAdapter
Dim _ds As DataSet
Dim scom As String = "SELECT CP_Name FROM [CountryPrograms]"
_da = New SqlDataAdapter(scom, cnnResource)
_ds = New DataSet()
_da.Fill(_ds)
If (_ds.Tables(0).Rows.Count > 0) Then
DataList1.DataSource = _ds
DataList1.DataBind()
For Each dr As DataRow In _ds.Tables(0).Rows
lbls.Text += dr("CP_Name").ToString()
Next
End If
End Sub
where i am getting value of lbls in datalist_itembound event using the findcontrol method to find the value of lable but I am seeing the first record again and again and my ul is not iterating on the database records??? any help


Nanhe SiddiqueRank #1,103 · 1.7K reputationPosted May 29, 2015, 3:30 AM EDT