S
Support
Hello:
I have a stored procedure that returns two record sets:
the first recordset returns two columns that have to do with internal error
handling processes
the second recordset returns a recodset containing multiple records
I would like to capture the second recordset into a datatable.......
Dim cn As New SqlConnection
cn.ConnectionString = GetConnectionString()
Dim cmd As New SqlCommand("Sproc_GenericGetDocTypes", cn)
cmd.CommandType = CommandType.StoredProcedure
Dim p1 As SqlParameter = cmd.Parameters.Add("@intAPPLICATIONSunid",
SqlDbType.Int, 4)
p1.Value = Applicationid
cn.Open()
Dim stuff As SqlDataReader
stuff = cmd.ExecuteReader()
While stuff.Read
GetDocumentTypes.RETURNED_ERROR = stuff("ERROR")
GetDocumentTypes.RETURNED_Answer = stuff("ANSWER")
End While
' go fetch the next recordset
stuff.NextResult()
Dim myDA As SqlDataAdapter = New SqlDataAdapter
Dim MyDataTable As New DataTable("DOCTYPES")
If GetDocumentTypes.RETURNED_ERROR = "000" Then
myDA.Fill(GetDocumentTypes.RETURNED_Dataset .............
<================== what should I put here ?
GetDocumentTypes.RETURNED_ERROR = TheError.Source
GetDocumentTypes.RETURNED_Answer = TheError.Message
myDA.Dispose()
End If
Thanks
I have a stored procedure that returns two record sets:
the first recordset returns two columns that have to do with internal error
handling processes
the second recordset returns a recodset containing multiple records
I would like to capture the second recordset into a datatable.......
Dim cn As New SqlConnection
cn.ConnectionString = GetConnectionString()
Dim cmd As New SqlCommand("Sproc_GenericGetDocTypes", cn)
cmd.CommandType = CommandType.StoredProcedure
Dim p1 As SqlParameter = cmd.Parameters.Add("@intAPPLICATIONSunid",
SqlDbType.Int, 4)
p1.Value = Applicationid
cn.Open()
Dim stuff As SqlDataReader
stuff = cmd.ExecuteReader()
While stuff.Read
GetDocumentTypes.RETURNED_ERROR = stuff("ERROR")
GetDocumentTypes.RETURNED_Answer = stuff("ANSWER")
End While
' go fetch the next recordset
stuff.NextResult()
Dim myDA As SqlDataAdapter = New SqlDataAdapter
Dim MyDataTable As New DataTable("DOCTYPES")
If GetDocumentTypes.RETURNED_ERROR = "000" Then
myDA.Fill(GetDocumentTypes.RETURNED_Dataset .............
<================== what should I put here ?
GetDocumentTypes.RETURNED_ERROR = TheError.Source
GetDocumentTypes.RETURNED_Answer = TheError.Message
myDA.Dispose()
End If
Thanks