ReadXML and WriteXML contains byte[]

Joined
Mar 19, 2010
Messages
2
Reaction score
0
Hi,

I have this datatable and one of the columns is byte[] to store image. I use writeXml function to write the datatable data into .txt file.

When i read back the .txt file to get the XML and put it in dataset (using readXML), that column's datatype becomes string. and how can i convert it back to byte[]?

Could somebody help me please? Thanks in advance for your help.

Regards,
-Lidya
 
Hi Guys,

I figured it out.

When i write the the datatable to .txt file using writeXML, the value in the byte[] column is saved as Base64String.

So when i read it using ReadXML, i just need to re-convert it back to bytes again by using Convert.FromBase64String(value);

Thanks anyway.

-Lidya
 
Back
Top