DataSet dsR=ds4;
dsR.Tables[0].PrimaryKey=new DataColumn[] {dsR.Tables[0].Columns["PartName"]};
DataRow foundRows = dsR.Tables[0].Rows.Find("渠道部");
dsR.Tables[0].Rows.Remove(foundRows);
dsR.Tables[0].PrimaryKey=new DataColumn[] {dsR.Tables[0].Columns["PartName"]};
DataRow foundRows = dsR.Tables[0].Rows.Find("渠道部");
dsR.Tables[0].Rows.Remove(foundRows);
博客展示了一段代码,对DataSet对象进行操作。将ds4赋值给dsR,设置dsR中第一个表的主键为PartName列,查找值为“渠道部”的行,最后将其从表中移除,体现了对DataSet数据行的处理。
2139

被折叠的 条评论
为什么被折叠?



