清空dataset里的某些单元格

 

  for (int i = 0; i < ds.Tables[0].Rows.Count; i++)

                {

                    for (int j = i + 1; j < ds.Tables[0].Rows.Count; j++)

                    {

                        if (ds.Tables[0].Rows[i].ItemArray[2].ToString() == ds.Tables[0].Rows[j].ItemArray[2].ToString())

                        {

                            ds.Tables[0].Rows[j][2]=null;

                            ds.Tables[0].Rows[j][4] = null;

                            string t = ds.Tables[0].Rows[j].ItemArray[2].ToString();

 

                            //GV_houselist.Rows[j].Cells[1].Text = "";

                            //GV_houselist.Rows[j].Cells[2].Text = "";

                        }

                        else

                        {

                            break;

                        }

                    }

                }

posted @ 2008-06-05 10:27  XGU_Winner  阅读(220)  评论(0编辑  收藏  举报