Cannot serialize interface ADODB.Recordset

Discussion in 'ASP .Net Web Services' started by Adam Short, Mar 23, 2005.

  1. Adam Short

    Adam Short Guest

    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
     
    Adam Short, Mar 23, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:%...
    > 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
    >
    >
     
    Manohar Kamath, Mar 23, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vikas Yadav
    Replies:
    0
    Views:
    1,131
    Vikas Yadav
    Sep 9, 2003
  2. Gordz
    Replies:
    3
    Views:
    3,945
    John Oakes
    Jun 7, 2004
  3. Replies:
    5
    Views:
    3,861
    Ray Costanzo [MVP]
    Sep 22, 2005
  4. Iain Porter
    Replies:
    7
    Views:
    220
    Iain Porter
    Jul 13, 2004
  5. Marathoner

    ADODB.Recordset as parm to Web Service

    Marathoner, Dec 28, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    161
    Dilip Krishnan
    Dec 29, 2004
Loading...

Share This Page