Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Cannot serialize interface ADODB.Recordset

Reply
Thread Tools

Cannot serialize interface ADODB.Recordset

 
 
Adam Short
Guest
Posts: n/a
 
      03-23-2005
When returning an ADO Recordset via Web Services I get the following error:

Cannot serialize interface ADODB.Recordset

Any Ideas?

--
Phuture-UK +44 (01202) 518122


 
Reply With Quote
 
 
 
 
Manohar Kamath
Guest
Posts: n/a
 
      03-23-2005
Adam,

Return the XML for the recordset, not the recordset itself. The following
example works:

[WebMethod]
public string GetRecordXML()
{
// Create a recordset object
Recordset rs = new Recordset();

// Create a stream object
Stream streamObj = new Stream();


// Query a table for a recordset
rs.Open("SELECT * FROM MyTable",
"dsn=LocalServer;UID=usernamehere;PWD=enter password here",
CursorTypeEnum.adOpenStatic, LockTypeEnum.adLockReadOnly, 1);

// Save the recordset's XML representation in a stream object
rs.Save(streamObj, PersistFormatEnum.adPersistXML);

// Get the string (XML) of the recordset
string outputXml = streamObj.ReadText(str.Size);

return outputXml;
}

When you get the recordset on the client side, you need to re-create it
using Open.

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com


"Adam Short" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> When returning an ADO Recordset via Web Services I get the following

error:
>
> Cannot serialize interface ADODB.Recordset
>
> Any Ideas?
>
> --
> Phuture-UK +44 (01202) 518122
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Is there anything that pickle + copy_reg cannot serialize? Jean-Paul Calderone Python 2 12-09-2005 11:23 AM
Re: Is there anything that pickle + copy_reg cannot serialize? Jean-Paul Calderone Python 1 12-08-2005 06:17 PM
Is there anything that pickle + copy_reg cannot serialize? Maurice LING Python 0 12-08-2005 02:42 PM
serialize to SQL Server Blob instead of XML serialize Gordz ASP .Net 3 06-07-2004 07:46 PM
Error : Cannot serialize member Humair Ahmed ASP .Net Web Services 1 04-26-2004 08:18 PM



Advertisments