110,539
社区成员
发帖
与我相关
我的任务
分享
dataset != null && dataset.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0
你把空格打出来啊 没空格就错了 public static DataTable QuerySqlDataTabe(string querySql)
{
EIInfo outInfo = ExecQuery(querySql);
DataSet ds = new DataSet();
outInfo.GetBlockVal(ds);
DataTable codeTable = ds.Tables[0];
if (codeTable.Rows.Count != 0)
{
DataRow newRow = codeTable.NewRow();
newRow[0] = "";
newRow[1] = "";
codeTable.Rows.InsertAt(newRow, 0);
}
return codeTable;
}
在吐槽一下,就算你的截图中codeTable.Rows.Count==0了,那他就直接return codeTable;有什么问题啊。