VB.NET

Moderators: seancampbell
Number of threads: 4020
Number of posts: 10026

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

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.