如何找出数据集中是否存在特定的 table

how to find out if a specific table exists in a dataset

我创建了一个应用程序,它从 excel 文件和二维数组中读取记录,并在合并它们之后将数据传递给 ds.table[x]。我想知道是否有办法让我检查 ds.table[x] 是否存在?我如何在代码隐藏中做到这一点?

您可以使用以下 if 语句进行检查,

 if(ds.Tables.Contains("TableName"))