DateTimePicker and Regional Setting
-
I'm using VS.NET 2005 Beta 2 and SQL Server 2005 Express to store personal information. The problem i'm facing is the MinDate value of a DateTimePicker cannot be set to below '1/1/2296'. My regional setting on my pc is set to Thailand (Thai year system is +543 from formal year format e.g. year 2005 in formal format is 2548 in Thai format). Also my SQL Server Collation is set to Thai. When i add a date info into the database via my app, it always adds 543 to the year value from DateTimePicker (2548 --> 3091). So the value in the database will always be 543 years over. Could anyone please help me out on this issue? KiT
-
I'm using VS.NET 2005 Beta 2 and SQL Server 2005 Express to store personal information. The problem i'm facing is the MinDate value of a DateTimePicker cannot be set to below '1/1/2296'. My regional setting on my pc is set to Thailand (Thai year system is +543 from formal year format e.g. year 2005 in formal format is 2548 in Thai format). Also my SQL Server Collation is set to Thai. When i add a date info into the database via my app, it always adds 543 to the year value from DateTimePicker (2548 --> 3091). So the value in the database will always be 543 years over. Could anyone please help me out on this issue? KiT
-
One quick and easy way (cheating a bit) to fix this is to simple subtract 543 years from the final date BEFORE you enter it into SQL ;P
I've tried that before but it didn't work. It seems like it adds 543 just before storing into the db. But when processing, it uses the displayed value. For example, if i try to store a year of 2520, it store 1977. But if i try -543, it says "Out of Range". What a headache... Don't know how to fix it. :(( KiT
-
I've tried that before but it didn't work. It seems like it adds 543 just before storing into the db. But when processing, it uses the displayed value. For example, if i try to store a year of 2520, it store 1977. But if i try -543, it says "Out of Range". What a headache... Don't know how to fix it. :(( KiT