SqlDataReader NextResult?
Hej med jer...Jeg prøver på at få min function som returnere en sqldatareader, til at returnere flere result sets, men uden held.
Min metode ser således ud:
-------------------------------------------------------------
sql = _
"SELECT TOP 10 Category FROM tabel1; "
'"SELECT TOP 10 Title FROM tabel2;"
cm = New SqlCommand
With cm
.Connection = mSqlFactory.Connect
.CommandType = CommandType.Text
.CommandText = sql
rd = .ExecuteReader()
End With
Dim fieldCount As Integer = rd.FieldCount - 1
Dim count As Integer
Do
While rd.Read
For count = 0 To fieldCount
Return rd
Next
End While
Loop While rd.NextResult
-------------------------------------------------------------
Hvad gør jeg galt?
Mvh
MF