473,803 Members | 3,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Recordset load XML

I'm writing a web service in .NET to work with Delphi clients. Delphi
uses ADO so I want to convert the Dataset to a Recordset and vice-
versa. It appears a Web Service cannot publish a web method with a
Recordset return so I save the RecordSet to an XML string:

SqlDataAdapter sa = new SqlDataAdapter( "Select * FROM " +
table , oConn);
DataSet ds = new DataSet();
sa.Fill(ds, table);
sa.FillSchema(d s.Tables[0], SchemaType.Sour ce);

Recordset rs = new Recordset();
rs = ConvertToRecord set(ds.Tables[0]);
Stream streamObj = new Stream();

// Save the recordset's XML representation in a stream object
rs.Save(streamO bj, PersistFormatEn um.adPersistXML );

// Get the string (XML) of the recordset
string outputXml = streamObj.ReadT ext(streamObj .Size);
The XML works fine in Delphi. Now I want to make changes and send back
the XML and load into a Recordset or reverse the process. The
Recordset doesn't have a Load method. I'm new to CSharp and am not
sure how to load the xml from ADO into a Recordset. I would like to
avoid using files and load the XML string. Is there a way of doing
this?

Thanks
John
Feb 3 '08 #1
2 7653
If recordset is what you want then you can load the xmlstring into a dataset
and then use ConvertToRecord set to get the recordset

--
Misbah Arefin

"john0600" wrote:
I'm writing a web service in .NET to work with Delphi clients. Delphi
uses ADO so I want to convert the Dataset to a Recordset and vice-
versa. It appears a Web Service cannot publish a web method with a
Recordset return so I save the RecordSet to an XML string:

SqlDataAdapter sa = new SqlDataAdapter( "Select * FROM " +
table , oConn);
DataSet ds = new DataSet();
sa.Fill(ds, table);
sa.FillSchema(d s.Tables[0], SchemaType.Sour ce);

Recordset rs = new Recordset();
rs = ConvertToRecord set(ds.Tables[0]);
Stream streamObj = new Stream();

// Save the recordset's XML representation in a stream object
rs.Save(streamO bj, PersistFormatEn um.adPersistXML );

// Get the string (XML) of the recordset
string outputXml = streamObj.ReadT ext(streamObj .Size);
The XML works fine in Delphi. Now I want to make changes and send back
the XML and load into a Recordset or reverse the process. The
Recordset doesn't have a Load method. I'm new to CSharp and am not
sure how to load the xml from ADO into a Recordset. I would like to
avoid using files and load the XML string. Is there a way of doing
this?

Thanks
John
Feb 4 '08 #2
"john0600" <jw*****@gmail. comwrote in message news:40******** *************** ***********@y5g 2000hsf.googleg roups.com...
I'm writing a web service in .NET to work with Delphi clients. Delphi
uses ADO so I want to convert the Dataset to a Recordset and vice-
versa. It appears a Web Service cannot publish a web method with a
Recordset return so I save the RecordSet to an XML string:

SqlDataAdapter sa = new SqlDataAdapter( "Select * FROM " +
table , oConn);
DataSet ds = new DataSet();
sa.Fill(ds, table);
sa.FillSchema(d s.Tables[0], SchemaType.Sour ce);

Recordset rs = new Recordset();
rs = ConvertToRecord set(ds.Tables[0]);
Stream streamObj = new Stream();

// Save the recordset's XML representation in a stream object
rs.Save(streamO bj, PersistFormatEn um.adPersistXML );

// Get the string (XML) of the recordset
string outputXml = streamObj.ReadT ext(streamObj .Size);
The XML works fine in Delphi. Now I want to make changes and send back
the XML and load into a Recordset or reverse the process. The
Recordset doesn't have a Load method. I'm new to CSharp and am not
sure how to load the xml from ADO into a Recordset. I would like to
avoid using files and load the XML string. Is there a way of doing
this?

Thanks
John
True that it doesn't have a "Load" method, However, the XML can be loaded using the Open method.

Open "Data.XML"

--
Al Reid

Feb 4 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1176
by: Martin CLAVREUIL | last post by:
hi all, how can i load in an adodb.recordset a remote xml file on another http server. if i use the simple ole-db provider, that work as an admin only. (according to ms, this component mustn't be used for non-interactive users. So i found serverxmlhttp but ... i can load the remote source in, i can load it in an domdoc, as describe in the msdn,
3
3913
by: Bruno Luis | last post by:
Hello I'm using A97 and i'm having some trouble with creating a recordset with data from two different databases. I connect to a remote database and make this data the default source for my continuous form (Set me.recordset = rs). The problem is: one of the fields of the remote database is a foreign key (two digit number), and the table with the correspondence is in my local database... i have no way of altering the remote database....
2
6688
by: Patrick Gonzalez | last post by:
Is it possible to use the built-in filter functions (ie. "Filter by Selection", etc..) when a form's recordsource has been set to a recordset object during the load event. When I try to do this, I receive the message "Cannot apply filter on one or more fields specified in the filter property". here is the code for the recordset creation: Set conn = New ADODB.Connection Set rsSQL = New ADODB.Recordset
2
9684
by: Lyn | last post by:
If I have a form where the RecordSource property is set to the name of a table, then on opening the SingleForm form I can cycle through all the records in the table one at a time via Next and Previous buttons on the form. However, I only want to cycle through a subset of the table. I have a parent form which inputs selection criteria. With the selection criteria I create a RecordSet (using ADO) in the parent form. The RecordSet object...
7
2744
by: Mac | last post by:
Hi all I have a asp.net application which calls a web service via a wdsl file which retrieves an XML String. The XML String is from a adodb recordset saved as via a stream. Dim oRS as New ADODB.Recordset Dim oStream as New ADODB.Stream
6
1801
by: Mark | last post by:
Hello. Before going further, I should mention that I have found a workaround for this problem. However, I thought it was sufficiently interesting to try to find out what is causing it. I have a form which launches when the application is started. The form is not initially databound. . .the user must first select a value from a combobox on the form. When the user selects a value, an appropriate recordset is created and cloned to the
3
2204
by: Codebug | last post by:
Trying to load a query in Access 2003 as a recordset, returns error 3061, too few parameters, Expected 1. Dim StrSQL As String Dim rs As DAO.Recordset Dim db As DAO.Database StrSQL = "<some_SQL_Statement>" Set db = CurrentDb()
1
2093
by: Tomino | last post by:
Hi all, I have a sticky question, it's killing me for weeks so i hope to find the answer here. I have a query to filter records from a table. From these results I want to edit the records with recordset, to make a recordset works fine, but to edit one made me an old man ... :-( Can somebody please tell me how to edit records with a recordset? The meaning is that I load the records in a subform on my existing form where the user can edit the...
4
2718
by: =?Utf-8?B?R1ROMTcwNzc3?= | last post by:
Hi Guys, thanks for your help yesterday, I've got one more question, then I think I'm done for now,... Is it possible to insert recordset data in a javascript, for instance I have a javascript code that calculates the total price, depending on number of units, currently what the code does is set the price like so - if qty 1 then £99+VAT if qty equall to or greater than 2 and equall to or less than 9 then price =
0
9565
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10550
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10317
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9125
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5633
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2972
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.