0
如何計算標題中具有相同前兩個字符的數據表列(動態創建)?這是我的代碼到目前爲止,但不工作。計算特定的數據表列
For col As Integer = 3 To dt.Columns.Count - 1
Dim cntLE, cntUE As Integer
If dt.Columns(col).ColumnName.Substring(0, 2) = "LE" Then
cntLE = dt.Columns.Count
ElseIf dt.Columns(col).ColumnName.Substring(0, 2) = "UE" Then
cntUE = dt.Columns.Count
End If
Next
請參閱下面的答案。另外,爲什麼你從'3'開始,而不是'For'循環中的'0'? – Shiva 2014-10-22 01:14:03