Syntax for "NULL" in asp.net

Discussion in 'ASP .Net Web Controls' started by xianxian chan, May 6, 2005.

  1. 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 ***
     
    xianxian chan, May 6, 2005
    #1
    1. Advertising

  2. xianxian chan

    Mythran Guest

    "xianxian chan" <> wrote in message
    news:...
    > 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
     
    Mythran, May 6, 2005
    #2
    1. Advertising

  3. xianxian chan, May 9, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kivak Wolf
    Replies:
    2
    Views:
    10,117
    Kivak Wolf
    Jun 28, 2005
  2. vizlab
    Replies:
    3
    Views:
    4,270
    Michael Bar-Sinai
    Oct 17, 2007
  3. Replies:
    16
    Views:
    7,425
    Mike Schilling
    Oct 12, 2005
  4. Replies:
    5
    Views:
    27,520
    Mike Schilling
    Mar 29, 2006
  5. Bo Peng
    Replies:
    13
    Views:
    13,482
    Siemel Naran
    Jul 18, 2004
Loading...

Share This Page