VB.NET

Moderators: seancampbell
Number of threads: 4022
Number of posts: 10035

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
date in datagridview Posted by thushara on 15 Jun 2010 at 9:15 AM
During Saving
Dim D As Date
If Not IsDBNull(DataGridView.CurrentRow.Cells(4).Value) Then
D = CDate(DataGridView.CurrentRow.Cells(4).Value)
Else
D = Now
End If
i dont want here D=now,if i comment it in the database it is saving as 01/01/1900,
i want null instead of that

Report
Re: date in datagridview Posted by seancampbell on 16 Jun 2010 at 10:07 AM
Database Date fields cannot store Null values. That is why it comes in with a Year 1900.

Hope this helps,
Sean C



 

Recent Jobs