D
David Potter
I have a stored proc that returns multiple results sets and I'm attempting to
use the DataContext Translate method. The first translate works but when I
can't move on to the next resultset as the datacontext has closed the
connection. How do I get around that?
I'm using the following code:
Dim myUserList As New List(Of Stc.BR.WcfContract.UserInformation.UserRow)
Dim myUserPermission As New List(Of UserInfo.UserPermissionRow)
' ... Other Code.
Using myRead As SqlDataReader =
myCommand.ExecuteReader(CommandBehavior.CloseConnection), _
myContext As New DataContext(myConnect)
' Read User Table
myUserList.AddRange(myContext.Translate(Of
UserInfo.UserRow)(myRead))
' Move to next table
myRead.NextResult() ' This fails because the connnection
is closed
myUserPermission.AddRange(myContext.Translate(Of
UserInfo.UserPermissionRow)(myRead))
End Using
use the DataContext Translate method. The first translate works but when I
can't move on to the next resultset as the datacontext has closed the
connection. How do I get around that?
I'm using the following code:
Dim myUserList As New List(Of Stc.BR.WcfContract.UserInformation.UserRow)
Dim myUserPermission As New List(Of UserInfo.UserPermissionRow)
' ... Other Code.
Using myRead As SqlDataReader =
myCommand.ExecuteReader(CommandBehavior.CloseConnection), _
myContext As New DataContext(myConnect)
' Read User Table
myUserList.AddRange(myContext.Translate(Of
UserInfo.UserRow)(myRead))
' Move to next table
myRead.NextResult() ' This fails because the connnection
is closed
myUserPermission.AddRange(myContext.Translate(Of
UserInfo.UserPermissionRow)(myRead))
End Using