Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataSetToXml() and trimming fields
Message
De
05/04/2008 20:49:37
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Titre:
DataSetToXml() and trimming fields
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01308460
Message ID:
01308460
Vues:
68
I have a DataSetToXml() method which does this:
        ' Convert a DataSet into an Xml
        ' This functions make it so the schema is included
        ' expO1 DataSet
        Public Function DataSetToXml(ByVal toDataSet As DataSet) As String
            Dim loStringWriter As StringWriter = New StringWriter()

            ' Adjust the dataset to avoid null values
            toDataSet = AdjustDataSetToAvoidNullValue(toDataSet)

            toDataSet.WriteXml(loStringWriter, XmlWriteMode.WriteSchema)
            Return loStringWriter.ToString
        End Function
However, once everything is in Xml, for those empty fields, I would like them to be trimmed. Because, in the Xml, this is what I would like to have:
<NewDataSet>
   <Temp>
      <MyField />
   </Temp>
</NewDataSet>
instead of:
<NewDataSet>
   <Temp>
      <MyField> </MyField>
   </Temp>
</NewDataSet>
How can I do that?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform