DataSet dataSet = new DataSet(); foreach (DataRow dataRow in dataSet.Tables[0].Rows) { string a = dataRow["xx"] as string; } 遍历第一个表的xx字段。
for (int i = 0; i < ds.Tables["tb_name"].Rows.Count; i++) { MessageBox.Show(ds.Tables["tb_name"].Rows[i]["字段名"].ToString(), "提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information); }
foreach (DataRow dataRow in dataSet.Tables[0].Rows)
{
string a = dataRow["xx"] as string;
}
遍历第一个表的xx字段。
{
MessageBox.Show(ds.Tables["tb_name"].Rows[i]["字段名"].ToString(), "提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
for(int k=0;k<dataSet1.Table[0].Rows.Count;k++)//总共有多少行
{
for(int p=1;p<dataSet1.Table[0].Columns.Count;p++)//每行有多少列
{
//dataSet1.Table[0].Rows[k].ItemArray.GetValue(p).ToString() ;行列对应的数据
}
}
ItemArray.GetValue(p)这是什么意思??
就这个意思 、哈哈
你按照这个写吧