i fill a strongly typed dataset from excel, and then i write the sourcefilename, source sheet, and rownr into the columns filename, sheetname and rownr in the dataset.
however excel takes takes the empty rows too into the dataset. like if the sheet has 100 active rows, but actually only the first 10 rows has values, the oledbdatadapter fill the dataset with these 100 rows and all the "cells" in the dataset in row 11-100 has (Null).
i have some ideas :
- before i write the filename, sheet, and rownr, i filter all the empty rows manually. i go through all rows and for each row i check the cell. if they are empty i delete them. but then i dont know anymore which row which rownr has (because there would be an empty row in the middle too)
- after i write the filename, sheetname and rownr i go through all rows and for each row i transpose it, put it in a new dataset, sort it, and see if the 4th row has a value. if no then i can delete this row.
does anyone has a better idea? (im sure there are many better ways.....)
however excel takes takes the empty rows too into the dataset. like if the sheet has 100 active rows, but actually only the first 10 rows has values, the oledbdatadapter fill the dataset with these 100 rows and all the "cells" in the dataset in row 11-100 has (Null).
i have some ideas :
- before i write the filename, sheet, and rownr, i filter all the empty rows manually. i go through all rows and for each row i check the cell. if they are empty i delete them. but then i dont know anymore which row which rownr has (because there would be an empty row in the middle too)
- after i write the filename, sheetname and rownr i go through all rows and for each row i transpose it, put it in a new dataset, sort it, and see if the 4th row has a value. if no then i can delete this row.
does anyone has a better idea? (im sure there are many better ways.....)