473,503 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strange Behaviors

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.

Nov 21 '05 #1
3 1455
"skOOb" <aa**********@gmail.com> schrieb:
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.


Please post the declarations of 'Date1' and 'Date2' and the code used to
fill these variables.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2
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?

Nov 21 '05 #3
"Not Aaron" <aa**********@gmail.com> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4245
by: Harlan Messinger | last post by:
I went to the W3C site to see if behaviors were discussed--something like CSS but for event handlers (onclick, etc.) rather than attributes. They are, at ...
8
1578
by: Noah Roberts | last post by:
There is some windows specific code in this, but I believe the issue to be something standard so... The problem is that after attaching the name of the subdirectory I have something like...
7
1652
by: William L. Bahn | last post by:
I'm working on some lessons and want to be sure I get some stuff correct. If any of this is covered in the FAQ, please feel free to point me to the section - I couldn't find it. ...
2
1919
by: Kris Vanherck | last post by:
yesterday i started getting this strange error when i try to run my asp.net project: Compiler Error Message: CS0006: Metadata file 'c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net...
6
1686
by: Gary | last post by:
I have an application that has been working just fine for a couple of years. It queries a SQL database and returns some formatted data back to the client. I have a new client, who has a larger...
0
1575
by: Andreas | last post by:
Hi! I'm using a custom collection with custom items to be edited with a custom CollectionEditor. This set of functionality is to be a part of a plugin for a SharpDevelop-based application. The...
1
1904
by: liubojin | last post by:
Hi guys, I have got some strange system behaviors regarding i/o delays in socket in python, here's the details: I'm writing a web proxy like program that intercepts and redirects requests from...
3
1809
by: Shelly | last post by:
I am encountering two strange problems. First one: I get a "server misconfiguration error", but only sometimes. It occurs on the first screen that accesses the database on a submit. This error...
0
1519
by: adamalton | last post by:
I'm trying to investigate the way PHP behaves in relation to timeouts and included scripts. PHP seems to do very strange things when scripts that include other scripts timeout, or when the included...
8
1900
by: Bo Yang | last post by:
Hi, Today, I make some test on the C++ STL iterators of set containers with GNU g++ compiler. The code is: #include <set> #include <iostream> using namespace std; int main(int argc, char...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7322
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6982
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5572
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.