RE: Filling a DataSet with an ADO Recordset or Record



Peter,

Thank you again for your response! I am new to C# and XML. I ended up
writing a routine to return an XML recordset through a string so I can send
it back to my ASP calling application. But I don't have any idea how to do
what you are saying to do. Can you give me some references to some samples? I
did a search for 'C# recordset xml' and haven't found anything to help yet. I
will keep searching.

We had this entire project written in VB6 as a com object which communicated
with the other agencies dcom object until the servers were upgraded to 2003
and a service pack which blew out their dcom object and my com object. So
they switched to web services and I am trying to do the same with as little
disruption to my ASP UI as possible. We are using SOAP in the ASP UI to
communicate to my new web service. In the old architecture we used recordsets
throughout as both input and output.

Thank you,
James

"Peter Bromberg [C# MVP]" wrote:

> Yes, because an ADO Recordset is a COM object and the .NET WebServices
> infrastructure doesn't know what to do with it. You have several options, the
> best one would probably be one of the Xml options the Recordset provides,
> which would flatten out the structure to xml or string that can be worked
> with.
> Peter
>
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "James" wrote:
>
> > Peter,
> >
> > Thank you for your response. In this project I am not creating a
> > recordset, a recordset is being sent to it from a classic asp application as
> > a paramater. This is running as a piece of the middleware between the the asp
> > UI and another web service that is communicating with a main frame cobol
> > application. I need to accept this recordset, put the data from fields into a
> > fixed length string to send on the the other web service which in turn runs a
> > cobol transaction on the main frame. The other web service and main frame
> > application are owned by another state government agency. When I build my
> > asmx file it says no errors but it returns the error - Cannot serialize
> > interface ADODB.Recordset.
> >
> > Here is my code:
> >
> > [WebMethod(CacheDuration = 30,
> > Description="Accepts an Authorization in an ADOc recordset format. It
> > returns an xml data stream with the return status and other specified data.
> > The return table name is rtnRS.")]
> > public string SendAuth(Recordset rsAuthForm)
> > {
> > string xmlString = "";
> > string authString = "";
> > string rtnString = "";
> >
> > OleDbDataAdapter da = new OleDbDataAdapter();
> > DataSet ds = new DataSet();
> > int intRowsRetrieved;
> >
> > // read the recordset into the dataset
> > intRowsRetrieved = da.Fill(ds,rsAuthForm,"auth");
> > intRowsRetrieved = da.Fill(ds.Tables["auth"], rsAuthForm);
> >
> > // create the fixed length string for the authorization header
> > authString = stringAuthHeader(ds);
> >
> >
> > ... and so on
> >
> > This is the only routine I use a recordset, all the others use a string
> > input and a string output. It was working great before implementing this part.
> >
> > Thank you for you help,
> >
> > James
> >
> >
> > "Peter Bromberg [C# MVP]" wrote:
> >
> > > Recordset rs = new RecordsetClass();
> > > rs.CursorLocation = CursorLocationEnum.adUseClient;
> > > rs.Open(strSQL, strConn, CursorTypeEnum.adOpenStatic,
> > > LockTypeEnum.adLockReadOnly, (int) CommandTypeEnum.adCmdText);
> > > OleDbDataAdapter da = new OleDbDataAdapter();
> > > DataSet ds = new DataSet();
> > > int intRowsRetrieved;
> > > intRowsRetrieved = da.Fill(ds, rs, "Customers");
> > > intRowsRetrieved = da.Fill(ds.Tables["Customers"], rs);
> > >
> > >
> > > --Peter
> > >
> > > --
> > > Co-founder, Eggheadcafe.com developer portal:
> > > http://www.eggheadcafe.com
> > > UnBlog:
> > > http://petesbloggerama.blogspot.com
> > >
> > >
> > >
> > >
> > > "James" wrote:
> > >
> > > > I am writing a web service for a classic ASP application. I need to consume
> > > > an ADO recordset and then send it to another web service for processing. I
> > > > found an MSDN ariticle telling how to do this
> > > > (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconfillingdatasetwithadorecordset.asp),
> > > > one big problem - it says to import ADOComponent.dll and msado15.dll. I found
> > > > msado15.dll but I can't find ADOComponenet.dll, neither on my machine or to
> > > > download from the web. Does anyone have it???
> > > >
> > > > Thank you!
.



Relevant Pages

  • Consume Web Service...
    ... to call a web service in my orchestration. ... Xml parameters as string datatypes and processes this Xml and returns ... ignoreCommit, XMessage msg) ...
    (microsoft.public.biztalk.general)
  • Re: how to return xml document from a web service
    ... public string MyMethod ... it out in SOAP Xml so ensure the clients have a way of knowing to decode it ... > I can't tell if the consumer of the web service will use .Net or maybe ... > XmlDocument webservice method ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: serialising parameters manually
    ... You'll be a better Web service developer if you ... You can find lots of more information on controlling the Xml ... >> Can anyone tell me how to serialise an arraylist manually? ... >> would be to serialise the objects to a string, ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: String compression
    ... something that was basically a web service. ... We did it by building the XML message, zipping it, then base64 encoding the ... Then we embedded that base64-encoded string inside of a very simple ... In those days we had to compress to file and then operate on the file. ...
    (microsoft.public.dotnet.languages.csharp)
  • Converting a Schema message to a string message and vice-versa
    ... public string Process ... conforms to a schema. ... drop an xml file into, and Biztalk pass this xml to the web method ... per the schema defined by my web service and a Send port and Send ...
    (microsoft.public.biztalk.general)