Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using XMLAdapter to create a dataset
Message
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Title:
Using XMLAdapter to create a dataset
Environment versions
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00973971
Message ID:
00973971
Views:
54
I'm using the XMLAdapter to create (what I though) was the equivalent of a serialized dataset, so I can access it from a .NET app (more specifically, the compact framework).

Here's the code I'm using:
loXML = CREATEOBJECT("XMLAdapter")
loXML.AddTableSchema("MyTable")
loXML.ToXML("C:\test.xml", "", .T.)
Is there something more to it than that? When I attempt to access it from .NET (from the .ReadXml() line), I get a FormatException thrown.

Here's the code:
System.Data.DataSet dsTest = new System.Data.DataSet();
try
   {				
      dsTest.ReadXml(@"test.xml");
      System.Data.DataRow drTest = dsTest.Tables[0].Rows[0];
      this.txtTest.Text = drTest["company"].ToString();
   }
   catch (FormatException ex)
   {
      this.txtTest.Text = "Error loading data..." + ex.Message.ToString();
   }
I even tried using a filestream instead to read the file, with the same results. So, I'm assuming I need to set something else in VFP, but I'm not entirely sure what.

Ideas?

Thanks,
-Paul

RCS Solutions, Inc.
Blog
Twitter
Next
Reply
Map
View

Click here to load this message in the networking platform