Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using XMLAdapter to create a dataset
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Titre:
Using XMLAdapter to create a dataset
Versions des environnements
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Divers
Thread ID:
00973971
Message ID:
00973971
Vues:
52
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform