老师你好:我的需求是:遍历指定列名数据,并按指定顺序进行排列,下面这代码出现了N个,如何处理?谢谢!
Dim dtb As DataTable = DataTables("试块取样")
Dim dr As Row = Tables("试块取样").Current
Dim nms() As String = {"品种种类","施工方量","供应商名称","设计强度","坍落度","试块留制_标准养护","试块留制_同条件养护","试块留制_拆模试块","取样人","见证人"}
Dim str As String
For Each dc As DataCol In dtb.DataCols
For i As Integer = 0 To nms.Length - 1
For Each nm As String In nms
If dc.Name = nm AndAlso dr.IsNull(nm) = False Then
str = str & dc.Name & ":" & dr(nms(i)) & ","
End If
Next
Next
Next
MessageBox.Show(str)