473,382 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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(ds.Tables[0], SchemaType.Source);

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

// 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(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 7627
If recordset is what you want then you can load the xmlstring into a dataset
and then use ConvertToRecordset 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(ds.Tables[0], SchemaType.Source);

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

// 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(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**********************************@y5g2000h sf.googlegroups.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(ds.Tables[0], SchemaType.Source);

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

// 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(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
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...
3
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...
2
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...
2
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...
7
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...
6
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...
3
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 ...
1
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...
4
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.