Re: date as null
From: JIM.H. (JIMH_at_discussions.microsoft.com)
Date: 01/12/05
- Next message: Rich Rekos: "Re: Send HTML Email from ASP.NET"
- Previous message: MWells: "Re: Class not working for textbox."
- In reply to: Steve C. Orr [MVP, MCSD]: "Re: date as null"
- Next in thread: Steve C. Orr [MVP, MCSD]: "Re: date as null"
- Reply: Steve C. Orr [MVP, MCSD]: "Re: date as null"
- Reply: Matt Berther: "Re: date as null"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 12 Jan 2005 13:35:12 -0800
I did Date = Date.MinValue and Date has only time value liek 12:00:00 and
when I try to call stored procedure it gives me out of range. Does
Date.MinValue give a default date? If yes, what is it? I am using 1/1/1950 as
default date.
"Steve C. Orr [MVP, MCSD]" wrote:
> The Date variable type cannot be null. It must have a value.
> Most people use Date.MinValue (or Date.MaxValue) to represent a null date in
> their code.
>
> Example:
> Dim MyDate as Date = Date.MinValue
>
> As for inserting it in the database, the other guys already specified that
> DBNull.Value is what you'll want to use.
>
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
>
>
> "JIM.H." <JIMH@discussions.microsoft.com> wrote in message
> news:ED62033C-3935-4DE0-A023-81AF0C37ED00@microsoft.com...
> > Hello,
> > I am calling a stored procedure to update my table.
> > If one of the date on the screen left empty, I need to send date as null.
> > Since MyDate="" gives error in asp.net, how should I do this?
> > Thanks,
> > Jim.
> >
>
>
>
- Next message: Rich Rekos: "Re: Send HTML Email from ASP.NET"
- Previous message: MWells: "Re: Class not working for textbox."
- In reply to: Steve C. Orr [MVP, MCSD]: "Re: date as null"
- Next in thread: Steve C. Orr [MVP, MCSD]: "Re: date as null"
- Reply: Steve C. Orr [MVP, MCSD]: "Re: date as null"
- Reply: Matt Berther: "Re: date as null"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|