日期:2014-05-18  浏览次数:20831 次

winform程序 删除数据不成功
private void pictureBox3_Click(object sender, EventArgs e)
  {
   
   
  #region 删除数据
  if (dataGridView1.Rows.Count > 0)
  {
  int index = dataGridView1.CurrentRow.Index;
  string KNumber = dataGridView1.Rows[index].Cells["客户编号"].Value.ToString();
  if (MessageBox.Show("删除后将不能恢复!", "提示信息", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
  {
  HXX.deleFNews(KNumber);
  dataGridView1.DataSource = HXX.KNews();
  }
  }[code=C#][/code]


------解决方案--------------------
这里的方法是正确的 错误可能在dal层的方法里