开发者

How to get data after DataView filtering?

开发者 https://www.devze.com 2023-03-07 02:59 出处:网络
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\'\";

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(colu开发者_如何转开发mn.Ordinal).SetCellValue(row[column].ToString());
   }
   rowIndex++;
}

So I need do the same with filtered data.


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

dtbl = dvUnloadOpenAccounts.ToTable();
//Then iterate your DataTable
0

精彩评论

暂无评论...
验证码 换一张
取 消