分组:
var dtResult = dt.DefaultView.ToTable(true, new string[] { "field1", "field2" });
Dim strGroup() As String = {"Supplier", "TrnDate", "Operator"}
Dim dtGroup As DataTable
dtGroup = dtPoReceipt.DefaultView.ToTable(True, strGroup)
根据字段排序:
dtView.DefaultView.Sort = "AvailableQty"
dtView = dtView.DefaultView.ToTable
新建计算列:
dtFreight.Columns("LocalFreight").Expression = "Freight*ExchangeRate"
计算列只读 dtSorDetail.Columns("SellingTax").Expression ="iif(Select=false,0,iif(TaxOption=0,0,iif(TaxOption=1,Price * TaxRate,Price / (1 + TaxRate) * TaxRate)))"
计算:
Dim obj As Object = dtM.Compute("sum(CaptureQty)", " Warehouse='" & Warehouse & "' and StockCode='" & StockCode & "'")