Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reading a .NET Dataset returned from a call
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Jet/Access Engine
Miscellaneous
Thread ID:
01224719
Message ID:
01224796
Views:
10
>I am trying out the .Net Extender from eTecnologia. So far it seems to work. I am connecting to a .NET .dll that is used to read and update an Access payroll database. I can now find, read, update and add records. However, I cannot decipher any retured data sets such as:
>
ds = PenSoftX.Company.GetIncomes
>
>ds is an object but I can't figure out what to do with it. (I made sure the company is open and I get no error till I try to work with DS.) The documentation gives this as a VB example:
>
>
Dim ds As DataSet
>ds = PenSoftX.Company.GetIncomes
>
>The resulting dataset will contain one table: Income.  The Income table will have three columns: Id, Title, and Abbreviation.
>
>I tried things like DS.id and ds.id(1) and all I get are errors saying "member not found". I also tried x = xmltocursor(ds). VFP was not happy.
>TIA


I'm not sure what the syntax would be with .NET Extender, but I'd think you'd be able to convert the dataset into XML, then use XMLTOCURSOR to turn that back into a cursor. Something like this:
// C# code, you'll have to translate
DataTable dt = ds.Tables[0];
System.IO.StringWriter writer = new System.IO.StringWriter();
dt.WriteXml(writer, System.Data.XmlWriteMode.WriteSchema, false);
string xml = writer.ToString();

* VFP code
XMLTOCURSOR(xml, "curMyCursor")
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Reply
Map
View

Click here to load this message in the networking platform