Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 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
  #1 (permalink)  
Old April 22nd, 2007, 12:03 PM
Registered User
 
Join Date: Apr 2007
Location: Mumbai, Maharashtra, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Nullable Datetime

How to handle Nullable Datetime with 3 tier in asp.net 2.0 (VB)


shivam
  #2 (permalink)  
Old April 22nd, 2007, 12:24 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

This is a way too broad question and simply begs for a Google search on the topic and some serious reading and self study.

Did you do that? Did you already read up a little about nullable types? If so, do you have any specific questions?

And to what chapter of the book is this related?

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
  #3 (permalink)  
Old April 26th, 2007, 12:42 PM
Registered User
 
Join Date: Apr 2007
Location: Mumbai, Maharashtra, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for reply.
It is not related to any chapter but in whole book there is no mention of how to handle nullable value. In practical time we come accross very often where we want null value in database.
As per book i am making 3 tier architecture whenever i am using datetime field i have to compularily fill the date in practise it is not possible.
Shortly i want to keep textbox of datetime to be inserted as null value in database & also how to handle with datareader.
Thanks

shivam
  #4 (permalink)  
Old April 26th, 2007, 12:46 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You can declare your date times as nullable date times. Then, whenever you need them you can use the Value and HasValue properties to get at the actual date.

With a reader, you would check for IsDBNull and only when it isn't assign the value from the reader to the DateTime object.

HtH,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.


Similar Threads
Thread Thread Starter Forum Replies Last Post
nullable datetimepicker.value Anar Visual Studio 2005 2 January 4th, 2010 04:29 PM
Nullable Type Question Aaron Edwards ASP.NET 2.0 Professional 1 August 30th, 2007 07:37 AM
Nullable DateTime formatting sajan C# 2005 1 March 19th, 2007 12:43 PM
Question about Nullable Types Aaron Edwards ASP.NET 2.0 Basics 5 December 10th, 2006 11:57 PM
Keycode is non-nullable salaikumar VS.NET 2002/2003 0 May 22nd, 2006 12:47 AM





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