I have created a library management system applicationn in vb.net... I have an issue form... which has issueid, issuedate, duedate..... these are set as "not null" in the datavase(sql server).. When I add a new issue and try to add another after that the DateTimePicker values doesn't get reset.... so eventhough i select it and issue the book(i.e., click on the issue button), it says "The DB doesnt allow Null Value".... How do i resolve this issue.. How do i refresh the DaateTimePicker aftereach issue is added??
Plz help!!!

6 Years
Discussion Span
Last Post by swaroop.striker

Hi Swaroop, this may be partly down to a serious problem with the datetimepicker - it only binds properly to non-null values. In other words, it doesn't work. It displays incorrect values. If this is part of the problem you may have to consider a nullabledatetimepicker control as an alternative (I have a vb version if you want it). I'm wondering, however, whether you really need null datetime values in your app. Shouldn't issuedate and duedate always have values? (default Datetime.today?)

My hunch is this: If you ensure default values - in your db and datatable datacolumns - or explicitly assigning values on adding rows - so you never have to deal with null values, you won't have to deal with the problems of the datetimepicker not binding properly.

ARe you updating your db via datatables and adding rows? If so maybe try lots of Debug.writeline(IssueRow.IsIssueDateNull.tostring) (or something like that) before and after clicking on the datetimepicker to find out where your null values are coming from?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.