Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 28th, 2005, 03:02 AM
Registered User
Join Date: Nov 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to set default value to datetimepicker control

Hi,I am using vs 2003 to create a win app.It has got a datetimepicker and it is bound to a datecolumn using its text property.
I am using the following code to add a new record
But the problem is,when i try to save the record without selecting a date it is giving an error saying "Column 'dateCol' doesnot allow nulls".When i select a date,its working fine. But i dont wanna select date everytime i enter a new record.I wanna set a default date like toyays date or the date on which i added the earlier record.I am going crazy due to this error.Plz help me.


Old December 8th, 2005, 10:09 PM
Registered User
Join Date: Mar 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

when u add new record just check if its null then assign todays date.

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I set default theme for all users? gujju BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 January 18th, 2008 10:25 AM
how do i set default parameter value.. rupen Classic ASP Basics 5 January 5th, 2007 12:14 AM
XMLDOM default character set sonicDace XML 0 May 21st, 2004 03:09 PM
how to set parameter default value oranginalab Classic ASP Basics 0 August 28th, 2003 02:53 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.