read at two datareader on while loop
The following code will read two datareader on a while loop:
mycommand = New Data.SqlClient.SqlCommand("SELECT * FROM MY_TABLE", myconnection)
myreader = mycommand.ExecuteReader()
While myreader.Read()
myothercommand = New Data.SqlClient.SqlCommand("SELECT * FROM MY_VIEW", myotherconnection)
myotherreader = myothercommand.ExecuteReader()
If myotherreader.Read Then
(do something here if it exist)
Else
(do something here if it doesn't exist)
End If
myotherreader.Close()
End While
myreader.Close()