problem with defaultview

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Toufik

    #1

    problem with defaultview

    Hi,
    I've a strange problem, when I execute the code below I've the error
    "An unhandled exception of type 'System.NullRef erenceException ' occurred in
    system.data.dll
    Additional information: Object reference not set to an instance of an
    object."

    Ive the error with the second row,
    the line: dsfrm.Tables("t ablename").Defa ultView(k).Item ("prix") = 0, can be
    executed without error,
    but after it the datarow
    dsfrm.Tables("t ablename").Defa ultView(k).Item ("taxe") gives me the erroor
    NULLREFERENCE EXCEPTION and the item "prix" gives me the same error.

    It looks like if the error appears after x changes made on
    "dsfrm.Tables(" tablename").Def aultView"

    Here is the code.
    dsfrm.Tables("t ablename").Defa ultView.RowFilt er = True

    For k = 0 To dsfrm.Tables("t ablename").Defa ultView.Count - 1

    dsfrm.Tables("t ablename").Defa ultView(k).Item ("prix") = 0

    dsfrm.Tables("t ablename").Defa ultView(k).Item ("taxe") = 0

    Next


Working...