Re: date as null

From: JIM.H. (JIMH_at_discussions.microsoft.com)
Date: 01/12/05


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.
> >
>
>
>



Relevant Pages

  • Re: date as null
    ... > 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. ... > Jim. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Either BOF or EOF is true . . .
    ... >fetches a result set from a SQL Server table using a SELECT statement. ... >stored procedure accepts an input parameter, and may return an empty result ... My program doesn't care if it gets an empty ... I get an exception "Project Outlook.exe raised exception ...
    (borland.public.delphi.database.ado)
  • Either BOF or EOF is true . . .
    ... fetches a result set from a SQL Server table using a SELECT statement. ... stored procedure accepts an input parameter, and may return an empty result ... My program doesn't care if it gets an empty ... I get an exception "Project Outlook.exe raised exception ...
    (borland.public.delphi.database.ado)
  • Re: Processing speed
    ... > include de-referencing variables and releasing unmanaged resources. ... How about using a stored procedure in the database to empty the tables? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Either BOF or EOF is true . . .
    ... With best regards, Mike Shkolnik ... > stored procedure accepts an input parameter, ... My program doesn't care if it gets an empty ... I get an exception "Project Outlook.exe raised ...
    (borland.public.delphi.database.ado)