Home All Groups Group Topic Archive Search About
Author
27 Sep 2006 8:14 PM
Jay
Hi ,
I am trying to assign a NULL value to a date (datatype). I am using VB
NET 2003. I know that date cannot be assigned a null value in 2003. I
cannot change the datatype as I am submitting the data to a web service
and it accepts only date (datatype). I dont want to display 01/01/0001
on the screen. I want to leave the date field as "blank".
Are there any suggestions to work around this problem.

thanks
Jay

Author
27 Sep 2006 8:18 PM
Herfried K. Wagner [MVP]
"Jay" <jayasunde***@gmail.com> schrieb:
> I am trying to assign a NULL value to a date (datatype). I am using VB
> NET 2003. I know that date cannot be assigned a null value in 2003. I
> cannot change the datatype as I am submitting the data to a web service
> and it accepts only date (datatype). I dont want to display 01/01/0001
> on the screen. I want to leave the date field as "blank".

Some approaches (the article is in German but the samples are in VB.NET):

<URL:http://dotnet.mvps.org/dotnet/articles/nullabledates/>

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
28 Sep 2006 3:53 AM
Cor Ligthert [MVP]
Jay,

In VB.Net the term Null exist only for database values.

However I assume you don't mean that. To represent the date element of a
datetime structure you can use

myDateTime.Date
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatetimeclassdatetopic.asp

I hope this helps,

Cor


Show quoteHide quote
"Jay" <jayasunde***@gmail.com> schreef in bericht
news:1159388080.269270.173860@k70g2000cwa.googlegroups.com...
> Hi ,
> I am trying to assign a NULL value to a date (datatype). I am using VB
> NET 2003. I know that date cannot be assigned a null value in 2003. I
> cannot change the datatype as I am submitting the data to a web service
> and it accepts only date (datatype). I dont want to display 01/01/0001
> on the screen. I want to leave the date field as "blank".
> Are there any suggestions to work around this problem.
>
> thanks
> Jay
>
Author
29 Sep 2006 9:31 PM
Jay
thanks for the info
Cor Ligthert [MVP] wrote:
Show quoteHide quote
> Jay,
>
> In VB.Net the term Null exist only for database values.
>
> However I assume you don't mean that. To represent the date element of a
> datetime structure you can use
>
> myDateTime.Date
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatetimeclassdatetopic.asp
>
> I hope this helps,
>
> Cor
>
>
> "Jay" <jayasunde***@gmail.com> schreef in bericht
> news:1159388080.269270.173860@k70g2000cwa.googlegroups.com...
> > Hi ,
> > I am trying to assign a NULL value to a date (datatype). I am using VB
> > NET 2003. I know that date cannot be assigned a null value in 2003. I
> > cannot change the datatype as I am submitting the data to a web service
> > and it accepts only date (datatype). I dont want to display 01/01/0001
> > on the screen. I want to leave the date field as "blank".
> > Are there any suggestions to work around this problem.
> >
> > thanks
> > Jay
> >