How to resolve CopyToDataTable is not a member of the System.Data.DataTable?

@Kakooza-Allan-Klaus

Just remove the CopyToDataTable and the column names should be inside { }

dT=dTCommissionData.DefaultView.ToTable(False,{"TERMINAL","TERMINA_LCIF","TERMINAL_NAME","BRANCH","REGION","Number_of_Transactions","TRAN_AMT","AGENT_COMMISSION","INTERSWITCH_COMMISSION"})

Because, DefaultView.ToTable returns a data table only

The documentation link

1 Like