DateTimePicker custom formatting not displaying

This is a WinForms, VB.NET app, using VS 2010 Pro. I added a datetimepicker to a form. Set the custom property to MM/dd/yyy. the relevant part of my function is as below:

        If IsDate(_uni.unitRentDate) Then
            t_TenantUnitRentDate.Value = _uni.unitRentDate
            If Not _uni.unitRentDate.HasValue Then
                t_TenantUnitRentDate.Value = New DateTime(2010, 1, 1)
            End If

        End If

_uni is a table in the EF and unitRentDate is stored in that table as DATETIME. The datetimepicker is t_TenantUnitRentDate.

The problem I am having is that when the form loads the dateTimePicker is showing the date in the format of this example Saturday , September 10, 2012 . This is not what I am wanting it to do at all.. It should be showing as 9/10/2012 . Why is this failing I looked at the date being returned from the database and it is showing a correct date value at that time.


Try it again by setting Format property to 'Custom'

Need Your Help

How do I mmap a _particular_ region in memory?

c++ c mmap

I have a program. I want it to be able to mmap a particular region of memory over different runs.

scroll position in div with master page

c# javascript gridview html

i have a div tag within a content tag as i am using a masterpage which has the forms and body tags.