Why not just execute the SP and then read back the results with the data
reader? You are just streaming through it after all, so no need for any of
these fancy .NET components.
Dim DataReader As SqlDataReader
' Guard.
Try
Dim Command As New SqlCommand
Command.Connection = m_Connection
Command.CommandText = "myStoredProcedure"
Command.CommandType = CommandType.StoredProcedure
Command.Parameters.Add("@some_parameter", SqlDbType.NText).Value =
some_parameter.value
Command.Parameters("@some_parameter").Direction =
ParameterDirection.Input
DataReader = Command.ExecuteReader()
If DataReader.HasRows = True Then
While DataReader.Read()
End While
End If
Catch sqlEx As SqlException
Finally
If Not DataReader Is Nothing Then
DataReader.Close()
End If
End Try
"Ian" <dr*****@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I wish to use a datareader to loop through the result set of a stored
procedure. (Several resultsets actually.)
It's for rendering HTML, so I don't need to ever keep this data, just
stream through it.
If I create a dataset, I can create a queryadapter, and then add
sprocs. It will only let me create that sproc as a return a value
(which I guess is the old RETURN_VALUE param) or return nothing.
It won't let me return a datareader.
If I create a sproc as the select statement as a table adapter, it
won't let me return anything other than a table, or a filltable. I
can't get at the datareader there either.
Further, if I add to the class via the partial class mechanism, I can't
see the _commandcollection object.
Any ideas?