很多删除代码都不能从物理上删除数据库里的数据,有的根本没反映,如:dataGridView1.Rows.RemoveAt(pIntRowIndex);((DataRowView)dataGridView1.SelectedRows[0].DataBoundItem).Row.Delete();ds.Tables[strTable].Rows[rowIndex].Delete();都不能真正删除...SQL 2005
SQL 2000 数据库分别如何删除?

解决方案 »

  1.   

    你这个只能删除DataSet或相应数据源的数据
     你需要同时操作数据库才行。
      

  2.   

    我的DataGridVIew第一列 是ComboBox  第二列是  编号 
                        for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
                        {
                            if (this.dataGridView1.Rows[i].Cells["Column1"].Value == null)
                            {
                                continue;
                            }
                            if ((bool)this.dataGridView1.Rows[i].Cells["Column1"].Value)
                            {
                                 //这个地方写删除
                                     //我这里是用的3层
                                //pgB.Delete(Convert.ToInt32(dataGridView1.Rows[i].Cells["Column2"].Value.ToString()));                             //dataGridView1.Rows[i].Cells["Column2"].Value.ToString())是得到编号   根据编号删
                                     //你自己想根据什么删就什么删  最好唯一的
                            }
                        }