Syntax for "NULL" in asp.net

X

xianxian chan

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?
 
M

Mythran

xianxian chan said:
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?

Either Nothing or DBNull.Value

hth,
Mythran
 
X

xianxian chan

thanks mythran,

i got it by using "Nothing" =)

have a nice dae =)

xianxian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top