Background: Included so people don't ask Why on earth I am doing this!
I have converted an ancient extremely long winded and complex stored procedure to .NET code as a huge update was required and all functionality was in the stored procedure and was far to complicated to update.
This stored procedure was consumed by classic ASP in multiple places within the website.
Requirement I now need to send the results of this new piece of .NET code back to classic asp as a recordset I intend on doing this by webservice
What I have so Far So far I have worked out that I can actually create a recordset in .NET like so
ADODB.Recordset rs = new Recordset();
and then return it as an xml string to asp (I have not tested this yet)
rs.Save(streamObj, PersistFormatEnum.adPersistXML);
// Get the string (XML) of the recordset
string outputXml = streamObj.ReadText(str.Size);
return outputXml;
In the asp I will then use this function which I found here in the asp to convert the xml back to a recordset
Public Function RecordsetFromXMLString(sXML As String) As Recordset
Dim oStream As ADODB.Stream
Set oStream = New ADODB.Stream
oStream.Open
oStream.WriteText sXML 'Give the XML string to the ADO Stream
oStream.Position = 0 'Set the stream position to the start
Dim oRecordset As ADODB.Recordset
Set oRecordset = New ADODB.Recordset
oRecordset.Open oStream 'Open a recordset from the stream
oStream.Close
Set oStream = Nothing
Set RecordsetFromXMLString = oRecordset 'Return the recordset
Set oRecordset = Nothing
End Function
The bit that's puzzling me In my .NET I have a generic list that contains all the data that needs to be returned. How do I get this in my recordset?