Wrong DateTime format

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

Guest

Hi!!!

I got an application that gets a dataset from oracle with a web-service.
when i bind the dataset to a grid, the date column is displayed fine.

then i can do ds.writexml() to store it locally on the pda.

the problem occurs when i do ds.readxml and bind the dataset.
now the date column are wrong.

how can i fix this ?
 
I would suspect you save your file without schema, so as soon as you reload
it all typing information is lost and your DateTime becomes string.
So, you see it as it was saved into the XML, not the default formatting of
a DateTime.ToString() as it used to be.
Consider saving and restoring schema prior to loading data.

If you need custom formatting, you can use Binding.Format event handler.
There's a sample in VS documentation on how to do that.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
Back
Top