Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2005

Tip: Looking for answers? Try searching our database.

Cannot serialize interface ADODB.Recordset

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Adam Short - 23 Mar 2005 14:25 GMT
When returning an ADO Recordset via Web Services I get the following error:

Cannot serialize interface ADODB.Recordset

Any Ideas?

Signature

Phuture-UK +44 (01202) 518122

Manohar Kamath - 23 Mar 2005 17:46 GMT
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.

Signature

Manohar Kamath
Editor, .netWire
www.dotnetwire.com

> When returning an ADO Recordset via Web Services I get the following error:
>
> Cannot serialize interface ADODB.Recordset
>
> Any Ideas?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.