I am using Excel Data Reader 2.1.2.0. In dataset I get a lot of blank rows that are obviously blank rows in excel.
How can I filter blank records? Is there any out of box functionality in excel data reader?
Comments: ** Comment from web user: pranavq212 **
How can I filter blank records? Is there any out of box functionality in excel data reader?
Comments: ** Comment from web user: pranavq212 **
I ended up removing empty rows from dataset like:
foreach (DataTable source in result.Tables)
{
for (int i = source.Rows.Count; i >= 1; i--)
{
DataRow currentRow = source.Rows[i - 1];
foreach (var colValue in currentRow.ItemArray)
{
if (!string.IsNullOrEmpty(colValue.ToString()))
break;
// If we get here, all the columns are empty
source.Rows[i - 1].Delete();
}
}
}
result.AcceptChanges();