Friday, March 16, 2012

Looping through dataSource

Hello,

I'm trying to convert some Classic ASP pages to ASP.NET 2.0. In one of my pages I created three panels with a heading and some links:

Header AHeader BHeader C- Link 1
- Link 2
- Link 3
- Link 1
- Link 2
- Link 3
- Link 4
- Link 1
- Link 2

Both the Header titles and the links are drawn from a database. The way I did this is:

- Make a recordset rs1 (SELECT Category_ID)
- Loop through the recordset rs1
* create a second recordset rs2 and select links WHERE Category is rs1.Category_ID
* Display all links from rs2 (loop)
* close rs 2
- Next record rs1
- Close rs1

Is this possible in ASP.NET 2.0? Can anyone get me started on this??

Thanks

sure...it's just some nested FOR EACH loops..

But you'll want to look at DataSet, not RecordSet. A quick google, or search here, will render many results.


Curt,

Thanks for pointing me in the right direction. While going through the Google results I came across an example that used Nested repeaters. With some adjustments it did exactly what I wanted!Party!!!

0 comments:

Post a Comment