set field to dbnull??

Discussion in 'ASP .Net' started by Gary, Apr 3, 2004.

  1. Gary

    Gary Guest

    In the following code the line: row("OrderDate") = DBNull is invalid. But,
    how can I set the field to DBNull?

    Thanks,

    Gary

    daClearOrders.Fill(DsClearOrders1)

    Dim row As DataRow

    For Each row In DsClearOrders1.Inventory.Rows

    row("QuantityOrdered") = 0

    row("OrderDate") = DBNull (this doesn't work)

    Next

    daClearOrders.Update(DsClearOrders1)
     
    Gary, Apr 3, 2004
    #1
    1. Advertising

  2. Gary

    Harold Hsu Guest

    Hi Gary,

    Try assigning DBNull.Value instead of DBNull.

    Harold

    "Gary" <> wrote in message
    news:...
    > In the following code the line: row("OrderDate") = DBNull is invalid.

    But,
    > how can I set the field to DBNull?
    >
    > Thanks,
    >
    > Gary
    >
    > daClearOrders.Fill(DsClearOrders1)
    >
    > Dim row As DataRow
    >
    > For Each row In DsClearOrders1.Inventory.Rows
    >
    > row("QuantityOrdered") = 0
    >
    > row("OrderDate") = DBNull (this doesn't work)
    >
    > Next
    >
    > daClearOrders.Update(DsClearOrders1)
    >
    >
     
    Harold Hsu, Apr 3, 2004
    #2
    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. Ravikanth[MVP]
    Replies:
    6
    Views:
    3,895
    Aemca
    Jul 18, 2003
  2. Boris Zakharin

    Adding a DBNull value to the database

    Boris Zakharin, Aug 27, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    390
    Boris Zakharin
    Aug 27, 2003
  3. dave
    Replies:
    1
    Views:
    2,880
    Teemu Keiski
    Nov 26, 2003
  4. Sound
    Replies:
    2
    Views:
    454
    Randy Webb
    Sep 28, 2006
  5. jr
    Replies:
    3
    Views:
    426
Loading...

Share This Page