时间:2021-07-01 10:21:17 帮助过:3人阅读
}
方法二:
foreach(DataRow myRow in myDataSet.Tables["temp"].Rows)
{
var str = myRow[0].ToString();
}
方法三:
foeach(DataRow dr in dt.Rows)
{
object value = dr["ColumnsName"];
}
方法四:
DataTable dt=new DataTable();
foreach(DataRow dr in dt.Rows)
{
for(int i=0;i<dt.Columns.Count;i++)
{
dr[i];
}
}
方法五
DataRow[] dataRows = null;
dataRows = dataTable.Select(fieldParentID + "=‘" + treeNode.Tag.ToSt
ring() + "‘", dataTable.DefaultView.Sort);
foreach (DataRow dataRow in dataRows)
{
DataRow dataRow = dataTable.Rows[i];
?? = dataRow[fieldParentID].ToString();
}
数据库的遍历
标签: