473,386 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Wierd prob with datetimepicker and MSDE db

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
Nov 21 '05 #1
0 898

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

Similar topics

9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
4
by: Jacek Jurkowski | last post by:
.... the minimum date of DateTimePicker is 1753-01-01. How to make DateTime to do not show nothing in its text if this date is the value? I have a form with a field LastLogonDate. If user hasn't...
7
by: Clamara | last post by:
When adding a new record from my form, I pre-set my DateTimePicker's value to System.DateTime.Today Since the "Today" value is used most of the time, the user doesn't need to select a date from...
3
by: Charlie | last post by:
In the top portion of the DateTimePicker, where the value of the date is displayed, how can I detect whether the month or day or year is currently focused, or, if ShowCheckBox = True, whether the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.