Issuing during exporting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello,

I am building an application for a pocket pc in which there need to be
facility to associates data with pictures. Now I need to sync this data on
the handheld to a desktop application programatically.

What i hav done I am exporting the data into an xml file using

ds.writexml()

function. AT the same time i am reading images data into binary array and
inserting this into the datatable of the dataset before writing it into xml.
By this way i have my data and image data both in the xml file. Now i
transfer this xml file to the desktop. In my desktop application i have an
import utility that reads the dataset created from this imported file
insertes the datainto the databse. Now I want to read the images that are in
the text form in the column. I want them to be conveted into byte array so
that i can write them with bianry reader.

Please can anyone help me out in this case. It is very urgent.

Thanks in advance

Sunil
 
I am not exactly sure if your import utility is inserting the whole xml content
into a single text column or xml content is inserted into a database table
with the same schema as the source data table

case 1: Xml content into a single text columns
You may use the same dataset schema(the one you use on the mobile side),
read the xml content with DataTable.ReadXml() and use code like this:

...
byte[] data = (byte[])dt.Rows[0][0];
MemoryStream ms = new MemoryStream(data);
pictureBox1.Image = new Bitmap(ms);

this code assumes that you'are using data column of type byte[] (xs:base64Binary)

case 2: database table with the same schema as the source data table
You may use the same dataset schema again. However you may use DataAdapter.Fill
and apropriate sql statement to populate the dataset.
Then the code from above may be used to read your image


Ruslan Trifonov
http://xman892.blgostpot.com
 
Back
Top