ASP Classic to VB.NET - Recursive Function including RecordSets

I'm hoping someone can help me think this one out because I'm stuck.We are slowly migrating a ASP Classic web site to a .NET web application. I stumbled upon the following function. The function will return an array of strings that consists of hml a-tags.\[code\]Private Function getFullPathLinks(lNodeId, sPath, sDocTemplate) Dim sql, recordSet, rsTmp Dim arrPath, sResult Dim lDocId lDocId = getDocumentId(lNodeId) sql = "SELECT parent_id, label FROM wt_node WHERE (node_id = " & lNodeId & ")" Set recordSet = execSqlCache(oConn,sql,Array(),Array("wt_node")) If Not (recordSet.Bof And recordSet.Eof) Then If sDocTemplate <> "" Then sPath = sPath & "|" & "<a href='" & sDocTemplate & "?nodeid=" & lNodeId & "&documentid=" & lDocId & "'>" & recordSet("label") & "</a>" Else sPath = sPath & "|" & recordSet("label") End If getFullPathLinks recordSet("parent_id"), sPath End If recordSet.Close Set recordSet = Nothing arrPath = arrReverse(Split(sPath,"|")) sResult = Join(arrPath,sPathDelimiter) If Right(sResult,Len(sPathDelimiter)) = sPathDelimiter Then sResult = Left(sResult,Len(sResult)-Len(sPathDelimiter)) getFullPathLinks = sResultEnd Function\[/code\]The function calls itself at the end and this will not work well in my .NET implementation where we are using DataReaders to talk to the SQL database.Could I follow the same structure as above and instead use something else than a DataReader to achieve this?
 
Back
Top