Dataset ds;
if (ds != null) {} //Check if Dataset is null.
if (ds.Tables.Count > 0) {} //Check if Dataset has any tables.
if (ds.Tables.Contains("tableName")) {} //Check if Dataset has a specific table name.
Datatable dt = ds.Tables["tableName"]; //Get the specific table.
if (dt.Rows.Count > 0) {} //Check if specific table has rows.
if (dt.Columns.Contains("columnName")) {} //Check if specific table has a specific column name.
1条答案
按热度按时间c86crjj01#
以下是测试中的数据集和表的几种方法: