Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get data after DataView filtering?

I apply a filter to Dataview and after that I need to get the filtered data. before filtering I did:

dvUnloadOpenAccounts.RowFilter = "uso_id = '30640'";
foreach (DataRow row in dvUnloadOpenAccounts.Table.Rows)
{
   HSSFRow dataRow = sheet.CreateRow(rowIndex);
   foreach (DataColumn column in dvUnloadOpenAccounts.Table.Columns)
   {
       dataRow.CreateCell(column.Ordinal).SetCellValue(row[column].ToString());
   }
   rowIndex++;
}

So I need do the same with filtered data.

like image 363
DmitryB Avatar asked Feb 24 '23 03:02

DmitryB


1 Answers

Assign a Filtered DataView to your DataTable, then you can iterate your DataTable.

dtbl = dvUnloadOpenAccounts.ToTable();
//Then iterate your DataTable
like image 115
Muhammad Akhtar Avatar answered Mar 08 '23 07:03

Muhammad Akhtar