Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   Syntax for "NULL" in asp.net (http://www.velocityreviews.com/forums/t776029-syntax-for-null-in-asp-net.html)

xianxian chan 05-06-2005 07:06 AM

Syntax for "NULL" in asp.net
 
Hi everyone,

what is the syntax for NULL if u guys know of any..


Cache.Add("ProductsTable", s, null, DateTime.Now.AddSeconds(60),
TimeSpan.Zero, CacheItemPriority.High, null)


i tried writing the code like this but when i put my mouse pointer over
the blue curly underline on the word "null", it says:-

'null' is not declared. 'Null' constant is no longer supported; use
'System.DBNull' instead.

Then, when i replace the word "null" with 'System.DBNull',
it says 'DBNull' is a type in 'System' and cannot be used as an
expression.

So what am i supposed to use for a NULL object?

*** Sent via Developersdex http://www.developersdex.com ***

Mythran 05-06-2005 03:40 PM

Re: Syntax for "NULL" in asp.net
 

"xianxian chan" <rschane03-vbforum@yahoo.com.sg> wrote in message
news:u3JuZogUFHA.2420@TK2MSFTNGP12.phx.gbl...
> Hi everyone,
>
> what is the syntax for NULL if u guys know of any..
>
>
> Cache.Add("ProductsTable", s, null, DateTime.Now.AddSeconds(60),
> TimeSpan.Zero, CacheItemPriority.High, null)
>
>
> i tried writing the code like this but when i put my mouse pointer over
> the blue curly underline on the word "null", it says:-
>
> 'null' is not declared. 'Null' constant is no longer supported; use
> 'System.DBNull' instead.
>
> Then, when i replace the word "null" with 'System.DBNull',
> it says 'DBNull' is a type in 'System' and cannot be used as an
> expression.
>
> So what am i supposed to use for a NULL object?
>
> *** Sent via Developersdex http://www.developersdex.com ***


Either Nothing or DBNull.Value

hth,
Mythran


xianxian chan 05-09-2005 02:21 AM

Re: Syntax for "NULL" in asp.net
 
thanks mythran,

i got it by using "Nothing" =)

have a nice dae =)

xianxian


*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT. The time now is 10:28 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.