For Each dt As DataTable In DataTablesIf dt.Name.Contains(Name) ThenMessageBox.Show(Name & "表已经存在,不能重复创建!")ReturnEnd IfNext
改成以下代码更好:
If DataTables.Contains(Name) Then MessageBox.Show(Name & "表已经存在,不能重复创建!") ReturnEnd If