Strange Behaviors

  • Thread starter Thread starter skOOb
  • Start date Start date
S

skOOb

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(Date2)).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.
 
skOOb said:
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(Date2)).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.

Please post the declarations of 'Date1' and 'Date2' and the code used to
fill these variables.
 
It isn't the data that is messed up since it continues to work on the
majority of computers. I am looking for ideas on to why this is
happening on just one computer. I msgbox the values from the dataset
and they are identical to a computer that runs the program fine. That
one computer might have a different setting somewhere making it throw
the error...any ideas?
 
Not Aaron said:
It isn't the data that is messed up since it continues to work on the
majority of computers. I am looking for ideas on to why this is
happening on just one computer.

I am asking for more details to get an idea why this is happening.
 

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

Back
Top