Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Attach a DataTable to a DataSet
Message
De
13/03/2005 18:05:04
 
 
À
13/03/2005 17:50:41
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 1.1
OS:
Windows 2000 SP4
Network:
Windows NT
Database:
MS SQL Server
Divers
Thread ID:
00995022
Message ID:
00995337
Vues:
23
Sylvain,

>On the client side, I couldn't find neither how to create a DataTable from a XML. All the methods that I've found that create a DataTable accept a XML from a stream or a file.<

Yeah, examples of this don't seem to be easy to find, but it's quite easy to do:
DataSet oData = new DataSet();
StringReader sr = new StringReader(XML);
oData.ReadXml(sr, XmlReadMode.InferSchema);
~~Bonnie



>Thanks Kevin. I looked at this technique, but could not find how to make it work. On the server side, GetXML return the XML without the schema. You need to call GetXMLSchema to get it. My understanding is that you should return a well-formed XML that contains both the data and the schema, but I can't find how to bind the results of GetXML and GetXMLSchema together.
>
>On the client side, I couldn't find neither how to create a DataTable from a XML. All the methods that I've found that create a DataTable accept a XML from a stream or a file.
>
>>Several people have also recommended converting the dataset to/from XML when you pass between physical boundaries (by using MyDataSet.GetXml). This would allow other programs to tap into your application.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform