下面就是在内存里建的数据表,用LINQ能像SQL一样方便地查询统计内存表
Dim dtResult As DataTable = New DataTable()
dtResult = argDataTable.Clone
For Each col As DataColumn In dtResult.Columns
Select Case col.ColumnName
Case "日期"
col.DataType = GetType(Date)
Case "订单号"
col.DataType = GetType(Double)
Case "客户工程名"
col.DataType = GetType(String)
Case "产品型号"
col.DataType = GetType(String)
Case "箱体尺寸"
col.DataType = GetType(String)
Case "物料号"
col.DataType = GetType(String)
Case "数量"
col.DataType = GetType(Double)
Case "单件工时"
col.DataType = GetType(Double)
Case "总工时"
col.DataType = GetType(Double)
Case "包装木箱尺寸"
col.DataType = GetType(String)
Case "分配日期"
col.DataType = GetType(Date)
Case "完工日期"
col.DataType = GetType(Date)
Case "生产小组"
col.DataType = GetType(String)
Case "箱体情况"
col.DataType = GetType(String)
Case "元器件情况"
col.DataType = GetType(String)
Case "备注"
col.DataType = GetType(String)
End Select
Next