G
Guest
Hi there,
I am desperate and need help on this from someone who actually knows what he
does... cuz I certainly don't ;-)
This is the situation:
I have an ASP.NET web application (written in VB.NET) in which the user can
create a job that will be run later by a service running in the background.
For tiing the job, the user can enter a date and a time. These values are
stored within an SQL table and the service polls this table periodically for
jobs to be executed.
Sounds simple.
But: In what way do I have to cope with the DateTime values, so that I don't
get into trouble when having different languages used on the server? I.e. the
code has to work on an english machine as well as on a german one.
Since SQL was really troublesome, I changed the tablestructure to store
DateTime values as varchar. The idea then was to convert every value to be
stored within this table into a specific type: 1/14/2005 15:43:00 for example
for January, 14th. Afterwards, when getting this value back into the service
or the webapplication, I wanted VB.NET to know this format and convert it
into the user defined culture.
This way, the display on the screen would be user dependent while storing
the values in a specific way on the other hand.
I used CurrentCulture for the user defined one and InvariantCulture for the
values to be stored in the database.
But whatever I try, I am still having mayor problems. Under specific
circumstances, I have DateTime.Parse reporting the value couldn't be
identified as a valid DateTime value...
However, ... having explained, what I want to achieve: Could anyone please
explain to me the way I should handle this?
Many many thanks in advance,
Christian.
I am desperate and need help on this from someone who actually knows what he
does... cuz I certainly don't ;-)
This is the situation:
I have an ASP.NET web application (written in VB.NET) in which the user can
create a job that will be run later by a service running in the background.
For tiing the job, the user can enter a date and a time. These values are
stored within an SQL table and the service polls this table periodically for
jobs to be executed.
Sounds simple.
But: In what way do I have to cope with the DateTime values, so that I don't
get into trouble when having different languages used on the server? I.e. the
code has to work on an english machine as well as on a german one.
Since SQL was really troublesome, I changed the tablestructure to store
DateTime values as varchar. The idea then was to convert every value to be
stored within this table into a specific type: 1/14/2005 15:43:00 for example
for January, 14th. Afterwards, when getting this value back into the service
or the webapplication, I wanted VB.NET to know this format and convert it
into the user defined culture.
This way, the display on the screen would be user dependent while storing
the values in a specific way on the other hand.
I used CurrentCulture for the user defined one and InvariantCulture for the
values to be stored in the database.
But whatever I try, I am still having mayor problems. Under specific
circumstances, I have DateTime.Parse reporting the value couldn't be
identified as a valid DateTime value...
However, ... having explained, what I want to achieve: Could anyone please
explain to me the way I should handle this?
Many many thanks in advance,
Christian.