This would better be described by 'serialization' than 'interop', but I
didn't find a newsgroup that seems closer on topic.
The problem in a few words: I save data with DataSet.WriteXML, but I get
different data back when I read it later with DataSet.ReadXml.
More detail:
I'm saving a dataset containing a single datatable to an XML file
(DataSet.WriteXml), and its schema to an xsd file (DataSet.WriteXmlSchema).
Then in another app, I load them back into a new empty dataset using
DataSet.readXmlSchema and DataSet.ReadXml. The schema is read first.
What's "special" is that one of the columns doesn't contain a simple text
or numeric data type, but binary data (an array of BYTE, currently fixed at
8 bytes for testing, it will be replaced by variable-length encrypted data
later).
When it is saved into the XML file, the binary data are automatically
encoded in Base64.
Now the problem is that when this is read back later, nothing gets decoded.
Instead of a copy of the original bytes I put in, I get a larger array with
the Base64 representation.
The schema as saved by WriteXmlSchema looks like this:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="PasswordList" xmlns=""
xmlns:xs="
http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="PasswordList" msdata:IsDataSet="true"
msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="PasswordData">
<xs:complexType>
<xs:sequence>
<xs:element name="License" type="xs:base64Binary"
minOccurs="0" />
<xs:element name="Password" type="xs:base64Binary"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
Some sample (test) data from the XML file:
<PasswordList>
<PasswordData>
<License>QjAwMDAwMg==</License>
<Password>dzB2KnQ3eGc=</Password>
</PasswordData>
<PasswordData>
<License>QjAwMzMwMA==</License>
<Password>Q0wuNko5VTQ=</Password>
</PasswordData>