At the end of
getDataTable()
, the object
_dt
goes out of scope and therefore dies.
Very likely, there is another
DataTable in your application and that is the one that you actually want to change.
Or you want to bind
_dt to a
DataGridView[
^] that is visible on one of your application's forms as its
DataSource[
^].
In this case, bound to another object, the instance
_dt, although no longer reachable through that identifier, will live on and show its values through the
DataGridView.