For Each c As Col In CurrentTable.Cols
Dim str As String
For Each dc As Col In CurrentTable.Cols
str = str & "," & dc.Name
str = str .Trim(",")
Dim fdr As DataRow = DataTables("表列名管理").Find("表名 = CurrentTable.name and 列名 In (" & str &")")
If fdr Is Nothing Then
Dim dr As DataRow = DataTables("表列名管理").AddNew
dr("表名") = CurrentTable.name
dr("列名") = c.Name
dr("列宽") = c.Width
Select Case c.DataCol.DataType.Name
Case "String"
If c.DataCol.MaxLength > 255 Then
dr("类型") = "备注"
Else
dr("类型") = "字符"
End If
Case "DateTime"
dr("类型") = "日期时间"
Case "Boolean"
dr("类型") = "逻辑"
Case "Int32"
dr("类型") = "整数"
Case "Int16"
dr("类型") = "短整数"
Case "Byte"
dr("类型") = "微整数"
Case "Double"
dr("类型") = "双精度"
Case "Single"
dr("类型") = "单精度"
Case "Decimal"
dr("类型") = "高精度"
End Select
End If
Next
Next
求助上面代码实现,如果表列名管理里的表名和列名已存在就不新增行,只是替换更新,表名列名列宽类型