C# DataTable
DataTableuserTable=ds.Tables["Book"];DataRow[]Rows=userTable.Select("BookID='"+bookid...
DataTable userTable = ds.Tables["Book"];
DataRow[] Rows = userTable.Select("BookID='"+bookid+"'");
foreach (DataRow row in Rows)
{
row.BeginEdit();
row["Count"] = row["Count"] - 1;
row.EndEdit();
}
不能自减? 展开
DataRow[] Rows = userTable.Select("BookID='"+bookid+"'");
foreach (DataRow row in Rows)
{
row.BeginEdit();
row["Count"] = row["Count"] - 1;
row.EndEdit();
}
不能自减? 展开
1个回答
展开全部
DataTable userTable = ds.Tables["Book"];
DataRow[] Rows = userTable.Select("BookID='"+bookid+"'");
foreach (DataRow row in Rows)
{
row.BeginEdit();
row["Count"] = Convert.ToInt32(row["Count"]) - 1;// row["Count"]取出来是obj型。需要拆箱
row.EndEdit();
}
DataRow[] Rows = userTable.Select("BookID='"+bookid+"'");
foreach (DataRow row in Rows)
{
row.BeginEdit();
row["Count"] = Convert.ToInt32(row["Count"]) - 1;// row["Count"]取出来是obj型。需要拆箱
row.EndEdit();
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询