Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #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: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:09 PM.


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