I'm trying to convert a site and this is giving me some trouble. I'm mainly confused by the nested query as I haven't seen this done in .NET, but I'm not expert either. Any ideas on converting this block would be appreciated.
Thank You.
<%
Dim Conn,rs,rsBand,rsLOGO,sSQL,sALPHA,sComments
If Request.Querystring("category_ID") > 0 Then Session("category_ID") = Request.Querystring("category_ID")
'--Connect to Database
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "driver={SQL Server};server="
'--Query to pull Alpha data from database
sSQL = "SELECT alpha_letter, alpha_ID" _
& " FROM dbo.BABL_Alpha_Letter" _
& " WHERE category_ID = " & Session("category_ID")
Set rs = Conn.Execute(sSQL)
'--Loop through all of the Alpha Letters------------------
Do Until rs.EOF
sALPHA = rs("alpha_ID")
Response.Write "<tr align='left'><td class='title'> <b>" & rs("alpha_letter") & "</b></td></tr>"
'--Query to pull Band data from database
sSQL = "SELECT *" _
& " FROM BABL_Band_Info" _
& " WHERE alpha_ID = " & sALPHA _
& " ORDER BY band_name"
Set rsBAND = Conn.Execute(sSQL)
Response.Write "<tr><td class='norm'>"
'---Loop through each of the bands for that alpha letter
Do Until rsBAND.EOF
sComments = rsBAND("comments")
Response.Write "<li><a href='" & rsBAND("band_url") & "' target='_blank'>" & rsBAND("band_name") & "</a>"
If sComments <> "" Then
Response.Write " - " & sComments
Else
Response.Write ""
End If
rsBAND.MoveNext
Loop
Response.Write "</td></tr>"
rs.MoveNext
Loop
Conn.Close
%>