ds.Tables.Count > 0 && ds.Tables[0].Rows.Count == 1
public MLimitUser GetModel(string strWhere) {
DataSet ds = GetList(strWhere);
//if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count == 1)
if (ds.Tables.Count > 0 )
{
//ds.Tables.Count =1;
string t=ds.Tables[0].Rows[0][0].ToString();//这里却 报错在位置 0 处没有任何行
//return DataRowToModel(ds.Tables[0].Rows[0]);
}
return null;
}
人气:163 ℃ 时间:2020-05-22 15:45:03
解答
估计是你的Tables[0]中没有值,你单步调试下,看看Tables[0]中有没有值
推荐
猜你喜欢
- 在核电荷数1----18的元素内,列举两个与氧核外电子层排布相同的离子符号
- 有甲乙两种卡车,甲车每次可装煤6吨,乙车每次可装煤8吨,现有煤146吨,要求一次运完,而且每一辆车都装满,需要甲乙两种卡车各多少辆?
- When is the Mother's Day?好,还是When is Mother's day?好.哪个句子比较恰当,个人觉得不要the 好一点
- -4,8,-16,32,-64.将这一行数前5个数用乘方表示.
- 1,2,3,4 0.8,4,2.8,2 2.7,9,0.9,3
- NH4NO3在水中的电离方程式
- 如何确定二次函数的表达式,即解法
- 为什么说点燃蜡烛时既有物理变化,又有化学变化?