none
Add row to Datatable RRS feed

  • Question

  • I have declared a datatable globaly in a application, and i assigned the datatable to the new datatable declared in the function. when i add a row or delete a row in the datatable declared in the function, it affects the both the datatable local table inside the function and global table in the class.

    How to fix this issue.

    Regards,

    N.Sathish

    Tuesday, September 25, 2012 3:47 PM

Answers

  • You need to pass the copy of the global data table to the function; otherwise function will modify the same instance of data table where global data table is referencing.

    You can use Copy method to create copy from global data table and pass it to the function, then function will work with the copy not the global data table.

    Tuesday, September 25, 2012 5:23 PM