Hi Andy,
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to save a bitmap into your
DataTable column and write it to Xml. If there is any misunderstanding,
please feel free to let me know.
When saving files, we can add a byte array column into the DataTable and
save the file as a byte array. We can open the bitmap files with a
FileStream object and read data into the array. Here is an example:
DataTable dt = new DataTable();
dt.Columns.Add("photo", typeof(byte[]));
dt.Rows.Add(dt.NewRow());
FileStream f = new FileStream(@"d:\a.bmp", FileMode.Open);
byte[] b = new byte[f.Length];
f.Read(b, 0, (int)f.Length);
dt.Rows[0]["photo"] = b;
Then we just add the DataTable to a DataSet and use DataSet.WriteXml()
method to save all these to an Xml file.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."