none
Set Field Value To Null

All replies

  • if hard coding the sql u can use it like this ... for a field name empname

     

    Code Snippet
    "update [tblname] set empname = null"

     

     

    or if assigning the sql via a variable you can assign it like this

     

    Code Snippet
    strEmpName = System.DBNull.Value

     

     

    if you're using a data row update it like this:

     

    Code Snippet

    Dim currentrow as Datarow = [row being updated]

     

    currentrow("EmpName") = System.DBNull.Value

     

     

    But just make sure the field you're updating can accept null values Smile

     

    Take care.

     

     

    Sunday, April 22, 2007 9:01 PM
  • If you have a condition and if you want the field value to be null if that condition is satisfied, then make the field as Calculated field and use the following expression:

    =IIf([Some Condition], Fields!YourField.Value, Nothing)

     

    or

     

    If you want a field value to be null for all rows in the dataset, again make the field as Calculated field and use the following expession:

    =Nothing

     

    Shyam

    Monday, April 23, 2007 6:15 AM