Note that there are some explanatory texts on larger screens.

plurals
  1. POTyped Dataset with null values to XML
    primarykey
    data
    text
    <p>When a typed DataSet is written to XML using ds.GetXml the columns with null values are removed from the XML. I know this is because the schema is not written etc. but is there a way to override this without having to parse through the DataSet and convert all database nulls to empty string before writing the XML?</p> <hr> <p><strong>EDIT:</strong> additional information:</p> <p>1)My main task is to take the DataSet and stream it to a WebRequest. So I am creating an XML doc</p> <pre><code>Dim xmldoc As New Xml.XmlDocument() xmldoc.LoadXml(dsUpload.GetXml) </code></pre> <p>and then uploading the xmldoc on a HTTpWebRequest(req) like this </p> <pre><code>Using xw As XmlTextWriter = New XmlTextWriter(req.GetRequestStream, System.Text.Encoding.Default) xw.Formatting = Formatting.Indented xmldoc.WriteTo(xw) xw.Close() End Using </code></pre> <p>2) I am talking about DBNull</p> <p>3) I need these columns to appear because the site I am uploading to needs all the tags to be included so they can parse it ( must be a legacy system)</p> <hr> <p>EDIT</p> <p>1) I agree the code is not efficient,but what i failed to mention is the uploading method is generic method in another class. Hence it accepts a XMLDoc because this same method services the upload of dataset as xml and a hardcoded string of XML</p> <p>2) Yes agree that only the System.String can be transformed to String.Empty.And thats mostly what my dataset has.</p> <p>3) LOL about the legacy system comment. Here is more ridiculous stuff.I think they probably parse the XML like they would a comma separated file.Anytime there is a comma in the data it throws it off!! :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload