Wierd prob with datetimepicker and MSDE db

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Steve Cutting (scutting_at_optusnet.com.au)
Date: 09/19/04


Date: Mon, 20 Sep 2004 08:37:54 +1000

Hi all,

I have created a form used for entry of repair details into a table on a
MSDE database. I am using a datetimepicker for entry of the repair date. It
is set to SHORT display format and I have UP/DOWN enabled.

The only 3 references to this control in my code are:
1. in my form load event
   datRepairDate.Value = Date.Today

 which sets the dtp value to today's date by default, and sets the
time to 0:00:00 since I am not interested in the time part

2. in my DB write routine which assigns the dtp value to my SQL parameter
 myCommand.Parameters("@date").Value = datRepairDate.Value

3. in my DB read routine which reads an existing record in for editing
    datRepairDate.Value = myDataReader("date")

99% of the time this works fine. However very occasionally I am somehow
getting the current system time inserted into the table alongside the date
the user has selected.

example from last night's testing:
I create a new repair record with a date of 18/9/2004 and add it to the
table.
I go to the SQL console in the IDE and run a query to view the new record.
Date on the new record is 18/9/2004 0:00:00 as expected.
I go back to my program and load that repair record back in.
I change the date to 20/9/2004 and update the record.
I run a query to view the record again.
Date on the record is now 20/9/2004 10:45 PM with that time being the
time I updated the record

This makes no sense since NOWHERE in my code do I assign the current time to
the dtp.
It is reset to 0:00 every time the form opens, so any new record must have
0:00 as the time portion. Therefore any existing record I read in and edit
must also have 0:00 as the time portion.

The trouble is that it works 99% of the time, and I have not been able to
isolate the exact conditions that cause the above to occur.

ideas anyone ??

thanks in advance
Steve



Relevant Pages

  • OEM installaton rendered useless by CD repair
    ... using my XP Home upgrade CD. ... got message 'unregmp2.exe - entry point not found' The ... repair is completed and go to set up a PPPOE DSL ...
    (microsoft.public.windowsxp.accessibility)
  • Re: Repair IE
    ... Go to Add/Remove Programs and repair Internet Explorer from there. ... Go to the entry for 'Microsoft Internet Explorer 6 SP1 and Internet Tools' ... If the above entry isn't there, you first need to uninstall all the patches ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • problem with Send-to menu entry
    ... Can you point me at a way to repair this? ... repair install without running into activation, and probably other, ... As she cannot 'send to' her CD drive, I have installed Nero Express, which ... Nero seems to have remover the 'send to CD' entry from my own installation. ...
    (microsoft.public.windowsxp.general)
  • Re: Re-Install
    ... Once it has picked up an entry of a drive letter into the registry, ... One is to try a repair install of the one on C: - Set the BIOS to boot ...
    (microsoft.public.windowsxp.general)