c.columns.add("pass",typeof(string))
foreach(DataRow dr1 in a.rows)
{
DataRow [] dtemp = b.select("pass="+dr1["pass"].tostring())
if(dtemp.Length>0)
{
DataRow drNew = c.NewRow()
drNew ["pass"] = dtemp[0]["pass"]
c.rows.add(drnew)
}
}
dataGridView.source = c//此处根据实际需求来
//未经测试,大概思路吧,你也可以不用b.select,b表也用foreach(),如
foreach(DataRow dr1 in a.rows)
{
foreach(DataRow dr2 in b.rows){
// do something
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)