While dr.Read() //read from access database
                
                Dim tb1 As New TextBox()
                tb1.ID = "tb" + i.ToString()
                WallDiv.InnerHtml += dr(0)
                WallDiv.InnerHtml += "<br>"
                WallDiv.InnerHtml += dr(1)
                WallDiv.InnerHtml += "<br>"
                WallDiv.InnerHtml += dr(2)
               'Create TextBox under each Comment
                WallDiv.Controls.Add(tb1)
                i = i + 1
            End While

Problem is that :-Loop breaks after one cycle only.Where as database is having 10 records.So,Ideally i should get:

dr(0)
dr(1)
dr(2)
textbox
dr(0)
dr(1)
dr(0)
dr(1)
dr(2)
textbox....so on 10 times

But I get only one cycle:-
dr(0)
dr(1)
dr(2)
textbox thats it.

Please suggest a solution to merge innerHTML and Add control alternatively multiple times.

First question is - are you sure the reader is holding more than 1 row? If not, that would explain the single loop.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.