locked
Filter empty rows and get the results RRS feed

  • Question

  • User-543160537 posted

    Hi,

    I am trying to get the total rows from excel and trying to filter the empty rows, but i getting error "system.data.datatable does not contains a defination for Tables and no extension method....

      DataTable filteredRows = ExcelReaderNew.ExcelToDataTable(fileName);
    
      DataTable FilteredRows = filteredRows.Tables[0].Rows.Cast<DataRow>()
                        .Where(row => !row.ItemArray.All(field => field is System.DBNull))
                        .CopyToDataTable();

    I am getting error on Tables[0] .... can anyone please e advice..

    Thanks

    Sree

    Tuesday, October 13, 2015 10:48 AM

Answers