473,654 Members | 3,066 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 (Date2)).Days, and
Date1.Subtract( Date2).Days.ToS tring().

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 1462
"skOOb" <aa**********@g mail.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 (Date2)).Days, and
Date1.Subtract( Date2).Days.ToS tring().

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**********@g mail.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
4260
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 http://www.w3.org/TR/1999/WD-becss-19990804 Are any current browsers implementing this? I know IE has something called "behaviors" but I don't know if it's the same thing, or in accordance with this standard.
8
1589
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 "d:\db\db-4.1.25\", which has 16 characters; but when it arrives in the next call it looks more like "d:\db\db-4.1.25\(clubs)", which has 17 characters. What is even more interesting is that the test "if (dir != '\\')" fails when there is a clubs at the...
7
1659
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. ---------------------------------------------------------------- Overflow/Wraparound behavior of integer values ---------------------------------------------------------------- If an arithmetic operation such as (+, -, *) yields a result that exceeds the...
2
1933
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 files\spsweb\0e3514bf\cb1844e7\assembly\dl2\3b163f 16\00452d31_84e5c301\infragistics.webui.ultrawebgrid.v3.dll' could not be found
6
1693
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 database than any of our previous customers. For example, the query to build the datatable now takes about 2 minutes instead of one minute or less. This is a third party database we are integrating with. He is getting very strange results. For...
0
1588
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 strange thing now is that my derived CollectionEditor's SetItems method is called when testing the collection editing within a small test application, but is NOT called when tested from within the SharpDevelop environment. Thus whenever I add...
1
1911
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 clients to my tomcat server, this proxy is written in python, and i'm starting a new thread to handle (redirect) the requests whenever there's a new client connected to my proxy. Each handler thread will read the http request line from the client...
3
1826
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 is intermittent -- sometimes it happens and sometimes not from the same screen with the same data. Here is the error:
0
1528
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 scripts themselves timeout. Just wondering if anyone else has ever investigated this world of mystery, or if they would like to join me in my quest into the unknown!!....?? It appears that in some cases php will return a completely balnk page...
8
1910
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 **argv)
0
8380
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8710
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2721
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1598
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.