J
john0600
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
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