DateTimePicker Error RRS feed

  • Question

  • how  to save nul  Value of DateTimePicker in the Database

    note:  i make dtp become null value  like this

    dtp.customformate="  " single space


    and the code to bind

    dtp.DataBindings.Add(New System.Windows.Forms.Binding("value", Me.GetAllCrimeDataBindingSource, "Date", True))
    Monday, March 29, 2010 5:45 AM


  • Khaleel,

    A datetime value can never be nothing or dbNull (It can be non instanced so in fact not exist but then is the object nothing).

    My approach for this, is that if it is for a DateTime2 (SQL Server 2008) to make that time 1, 1, 1 and for a normal DateTime 1753,1,1 that are the lowest posible DateTime values in a Microsoft database 

    • Marked as answer by Chao Kuo Friday, April 2, 2010 9:12 AM
    • Unmarked as answer by KhaLeeL ZoURoB Saturday, April 3, 2010 3:00 AM
    • Marked as answer by KhaLeeL ZoURoB Saturday, January 24, 2015 10:29 AM
    Monday, March 29, 2010 6:30 AM