Sad Code:
Dim MyTable As New DataTable 'Creates 1st data table
MyTable = MyFunction.GetDataTable() 'Destroys 1st data table and creates another
Happy Code:
Dim MyTable As DataTable
MyTable = MyFunction.GetDataTable()
Or if you prefer the quickie version:
Dim MyTable As DataTable = MyFunction.GetDataTable()
No comments:
Post a Comment