Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to manipulate dataset from .NET
Message
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
00802688
Message ID:
00805070
Views:
19
Hi John,

When ADO.NET DataSets are returned from a Web Service, the VFP cunsumer will get a XMLDOM object representing the DataSet. So, you have to do something like this at your client side:
*-- Calls a Web Method that returns an ADO.NET DataSet
*-- At this side of the wall, we will receive a DOMDocument object.
LOCAL loDataSet as "MSXML2.IXMLDOMDocument" 
LOCAL loSchema  as "MSXML2.IXMLDOMElement"
LOCAL loData    as "MSXML2.IXMLDOMElement"
loDataSet = loMyWebService.MyMethodThatReturnsADataSet()

*-- Lets return the XML fragments for the Sechema and Data parts
loSchema = loDataSet.item(0)
loData   = loDataSet.item(1)

*-- Lets create an XMLAdapter and load the data and the schema
LOCAL loXMLAdapter as XMLAdapter
loXMLAdapter = CREATEOBJECT("XMLAdapter")
loXMLAdapter.Attach(loData, loSchema)

*-- Finally, we generate a cursor from the XML
LOCAL loXMLTable as XMLTable
loXMLTable = loXMLAdapter.Tables.Item(1)
loXMLTable.ToCursor(.F., "MyCursor")

BROWSE
HTH.
-----
Fabio Vazquez
http://www.fabiovazquez.com
Previous
Reply
Map
View

Click here to load this message in the networking platform