Dim dt As DataTable '定义一个数据表变量 Dim cmd As new SQLCommand cmd.CommandText = "Select 第二列,第三列 From {表A}" dt = cmd.ExecuteReader() '生成一个临时表 Dim fdr = dt.find("第三列 is not null") If fdr Is Nothing Then dt.DataCols.Delete("第三列") End If msgbox(dt.datacols.count)