I am having an issue right now of displaying the 'Age' of an item, but
only on 1 computer. I can take my app and install it on multiple
win98, winNT, and other winXP machines and have no problem. I install
it on one computer (my boss's btw) and it doesn't work. I'll try and
explain what I am trying to do.
I am using MySQL 4.0.17 with VB.NET 2003. I need to calculate the
difference of two dates, one of which is stored in the database, the
other is 'Now'. My process of getting info from the DB: I query the DB
with 10 columns of information, and usually returns about 10 rows.
Once I fill the DataSet I wrote a function to traverse the column that
stores the Date, and then calculate the difference and store it in the
column that stores the Age. Then populate my datagrid with the
dataset. It works like a charm on 99% of the computers I test it on
except the one that matters (talk about murphys law).
Some facts: The date field is stored as type 'datetime' in MySQL (which
looks like '0000-00-00 00:00:00'). And I convert it to look like
'00/00/0000' within the query using date_format to make VB.NET happy
about converting it. I've used about 3 different ways of calculating
the difference, including: DateDiff,
DateTime.Parse(Date1).Subtract(DateTime.Parse(Date 2)).Days, and
Date1.Subtract(Date2).Days.ToString().
The Error: Either "Cast from type 'Byte()' to type 'Date' is not valid"
or "Cast from type 'Byte()' to type 'String' is not valid"
depending on which calculation I use.
I am looking for some ideas as to why this is happening. I do not see
why this is happening on just 1 computer. Any ideas?
Thanks in advance.
Oh Yeah, just to add to the madness...that 1 computer works fine when
it points to a MySQL 4.1 or 5.0 server. So all computers work fine
when pointed to 4.1 or above, and only 1 doesn't when pointing to
4.0.17.