ds.Tables.Count > 0 && ds.Tables[0].Rows.Count == 1
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/11 16:21:17
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;
}
估计是你的Tables[0]中没有值,你单步调试下,看看Tables[0]中有没有值
ds.Tables.Count > 0 && ds.Tables[0].Rows.Count == 1
ds.Tables[0].Rows.Count > 1
ds.Tables[0].Rows.Count>0错误
if (ds.Tables[0].Rows.Count >
Tables[0].Rows.count是什么意思
ds.Tables[0].Rows.ds.Tables[0].Clone()是什么意思?
this.TbEmployeesName.Text = ds.Tables[0].Rows[0]["StaffName"
this.txtID.Text = ds.Tables["stuinfo"].Rows[0]["stuid"].ToSt
C#:问一个比较简单的问题,ds.Tables[0].Rows.Count获取的是什么?如果结果集是空的,返回是0还是-
用c#做系统时此句 this.tbid.Text = ds.Tables[0].Rows[0]["书号"].ToStri
ddl.DataSource = ds.Tables[Tname];什么意思
this.dataGrid1.DataSource=ds.Tables["login"];是什么意思