I would suggest re-instantiating your
redr object for each iteration of the outer loop as I do not believe there is a way to more an OLEDBReader back to the start.
As an alternative you could populate a datatable with the information then just read through that.
so outside your outer loop do something like:
Dim dt as DataTable = new DataTable()
dt.Load(redr)
Then instead of your inner while do:
ForEach dim dr as DataRow in dt.rows
root = dr(0).ToString()
nextNode = dr(1).ToString()
If root = t1 And nextNode = t2 Then
MsgBox("Direct LinkFound")
linkfound = True
Exit For
ElseIf root = t1 Then
DFSStk.Push(nextNode)
End If
next