I have a DateTimePicker in my C# application and it works properly on everyone's computer (except one) to select specific dates.
I noticed that on the one problem computer that when the DateTimePicker is used it sets the date a little different that on working computers.
His looks like this once he uses the calendar:
'February -14-12'
Mine looks like this:
'Tuesday , February 14,2012'
Once he selects a specific date the above shows up but an exception arises:
System.Data.SqlClient.SqlException: Conversion failed when converting date and/or time from character string.
This is the only code I can think of to submit:
Expand|Select|Wrap|Line Numbers
- dtpAppts.Value.ToShortDateString()
I understand the cast problem above but why wouldn't an else have the same problem? My thoughts point to a local system problem but he's using the same OS and setup as everyone else (Windows 7 pro with SP1).
I have a feeling it's not a problem with the C# coding but a problem with the querry, or how C# is interpreting it...or something like this. Strange though, only on one computer?
Does anyone have any thoughts?
Thanks very much,
~ Chris