Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何查找数据表中的列是否为 Null (或) Not。如果我的数据集(DS)包含 1 个 Data_Table 和 2 列。我想检查第 2 列是否为 Null (或) Not。
如果您说数据集中有一个 2 列表,那么请执行...
isColumnEmpty = false; DataColumn column = dataSet.Tables[0][1]; // get column 2 from table 1 foreach(DataRow row in column) { if (row[0] == null) // check the only column of this row then isColumnEmpty = true; break; }