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;
}
人气:409 ℃ 时间:2020-05-22 15:45:03
解答
估计是你的Tables[0]中没有值,你单步调试下,看看Tables[0]中有没有值
推荐
猜你喜欢
- 已知二次函数f(x)=(lga)x2+2x+4lga的最大值是3,求a的值.
- 求八年级下数学书练习题(人教版)!
- 天然水体中腐殖质有哪些来源?
- 罗曼罗兰为何“在此英勇的队伍内 把首席给予坚强与纯洁的贝多芬”
- 把棱长1米得正方体切割成棱长1分米的小正方体,把这些小正方体摆成一排,长多少米?
- 举例说明,匈奴对中原汉王朝构成的强大的威胁是什么
- We的名词性物主代词是什么?
- England,most,Christmas,important,is,the,festival,in(连词成句)