比如代码
Dim ary() As String = {"第一列", "第二列"}For Each c As DataCol In DataTables("表A").DataCols If array.Indexof(ary, c.name) >= 0 Then c.AllowEdit = True Else c.AllowEdit = False End IfNext