
ds.Tables.Count > 0 && ds.Tables[0].Rows.Count == 1
ds.Tables.Count>0&&ds.Tables[0].Rows.Count==1publicMLimitUserGetModel(stringstrWhere)...
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;
} 展开
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;
} 展开
3个回答
展开全部
估计是你的Tables[0]中没有值,你单步调试下,看看Tables[0]中有没有值

2025-03-10 广告
公司具有国际互认的第三方检验检测资质,为客户提供科学、公正、权威、及时的检验检测报告.一家专注包装科研与检验检测的第三方检测机构,华南包装技术在第三方检测细分领域(包装)的专注与贡献,在业界有口皆碑。...
点击进入详情页
本回答由华南检测机构提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询