dbnull

Is there an easy way in Reporting service to handle dbull in dataset

I am using the local mode of the new reportviewer control, when I feed the dataset to the report, if there are some dbull column, an exception will be thrown.

To those string column, I can set NULLVALUE property to empty, but to other datatype, like integer, datetime, money, what should I do

Thanks


Answer this question

dbnull

  • Kate O

    DBNull is translated to a unitialized object in the report. You can use IsNothing, i.e. IsNothing(Fields!Foo.Value).

  • Krishnan MSFT

    If this solves your problem, please mark the question answered. Thanks. :)



  • renz2k7

    Hey, you know what, it is very strange.

    If I use BindingDatasource.datasource = ds.tables(0), (BindDatasource is bound to ReportViewer), I will have exception if any field is null.

    But if I use
    BindingDatasource.datasource = ds
    BindingDatasource.datamember = "Table1"

    I don't get exception any more.

    Don't why, but it works like charm.

    Wei

  • New Guy

    In addition to =IsNothing(Fields!Foo.Value), you could use the IS keyword: (Fields!Foo.Value is Nothing)

    -- Robert

  • dbnull