Wrong DateTime format

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

Ilya Tumanov [MS]

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.
--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top