c# - Removes several sets of datacolumns from datatable? -
i'm bulk-uploading excel file 470 columns datatable. due mssql's row size limit of 8060 bytes, need delete many datacolumns. cannot pick-and-choose excel files can upload.
these datacolumns need delete: cols [180-195], [220-245], [320-380], [430-465].
i understand can loop , delete first batch (cols 180-195) using exact column number. 2nd, 3rd, 4th batch, there way besides having subtract total i've deleted col num i'm delete , avoid out-of-index exception?
in case, when 4th batch (430-465) instead of deleting cols 430-465, believe deleting columns 330-365 (15+25+60 previous deletes)
thanks.
in loop, start last column , move towards first one. way can refer original column numbers , don't have deal shifts take place if delete columns in middle.
Comments
Post a Comment