M
Manoj Misran
Dear Gurus,
I have a strange problem. Following code is working with no problems
on 10 different computers but only on one specific Win2K PC, it is not
working for a specific user ID. The problem is very strange. Look at
the code first:
DateTime myCreationDate;
object myDate = myOleDbReader.GetDateTime(myOleDbReader.GetOrdinal("CreationDateTime"));
if (myDate!=null)
{
myCreationDate = DateTime.Parse(myDate.ToString());
}
else
{
myCreationDate = DateTime.MinValue;
}
Now this code snippet gives me an Exception on "DateTime.Parse"
function that says "String was not recognized as a valid DateTime".
But it works on 10 of the 11 Computers and even on this 11th computer
it DOES work with all other user IDs except only one user. Everything
is same.
I did some research and found an interesting thing. The date value
stored in Database is "4/2/2003 6:10:00 PM". Now for all the working
users, the myReader.GetDateTime() function gives me the same string
and it parses correctly but on that one PC for that one user what I
get is "4/2/2003 18:10:00 PM" that gets an exception while parsing. I
don't know why it is showing 18 instead of 6 just for that one user on
this specific PC. Is there any setting that I need to check for this
user.
PS: This user is a network domain user and I checked with other domain
users, it works perfectly allright with other domain and local users.
Thanks in advance.
-Manoj Misran
(e-mail address removed)
I have a strange problem. Following code is working with no problems
on 10 different computers but only on one specific Win2K PC, it is not
working for a specific user ID. The problem is very strange. Look at
the code first:
DateTime myCreationDate;
object myDate = myOleDbReader.GetDateTime(myOleDbReader.GetOrdinal("CreationDateTime"));
if (myDate!=null)
{
myCreationDate = DateTime.Parse(myDate.ToString());
}
else
{
myCreationDate = DateTime.MinValue;
}
Now this code snippet gives me an Exception on "DateTime.Parse"
function that says "String was not recognized as a valid DateTime".
But it works on 10 of the 11 Computers and even on this 11th computer
it DOES work with all other user IDs except only one user. Everything
is same.
I did some research and found an interesting thing. The date value
stored in Database is "4/2/2003 6:10:00 PM". Now for all the working
users, the myReader.GetDateTime() function gives me the same string
and it parses correctly but on that one PC for that one user what I
get is "4/2/2003 18:10:00 PM" that gets an exception while parsing. I
don't know why it is showing 18 instead of 6 just for that one user on
this specific PC. Is there any setting that I need to check for this
user.
PS: This user is a network domain user and I checked with other domain
users, it works perfectly allright with other domain and local users.
Thanks in advance.
-Manoj Misran
(e-mail address removed)