Hi Folks, I'm trying to loop through my query results using datareader. I want to create a submenu by checking the subtitle exists then concatenate the values. while (reader.Item("subtitle").tostring() <> "") submenu &= "<p>" & reader.Item("subtitle") & "</p>" end while The page wont seem to load though, it must be a problem with the loop, do you know how I can read the next item? Here is my comlpete code: Code: While reader.Read() ' set title sitename = reader.Item("sitename") mydata &= "<p>" & reader.Item("pagetitle") & "</p>" 'check for subpages then create submenu if (reader.Item("subtitle").tostring() <> "") while (reader.Item("subtitle").tostring() <> "") submenu &= "<p>" & reader.Item("subtitle") & "</p>" end while 'concatenate submenu to main data mydata &= submenu End if End while
dude u have to advance the dr to the next item in the dataset else the loop becomes infinite thus the page appears stuck... !!