问题已经解决,把方案贴上来,希望对搜到这个帖子的童鞋有点帮助
修改后的代码:        private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            if (DialogResult.OK == MessageBox.Show("是否要修改", "", MessageBoxButtons.OKCancel))
            {
                Users user = new Users();
                user.UserName = this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
                user.Password = this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
                string sql = "update [用户表$] set 用户名='" + user.UserName + "',密码='" + user.Password + "' where 用户名='" + user.UserName + "'";
                int count = OledbHelper.ExecuteNonquery(sql);
                if (count == 1)
                {
                    MessageBox.Show("修改成功");
                    Thread thread = new Thread(DoWork);
                    thread.Start();
                }
            }
        }
        public delegate void MyInvoke();
        public void DoWork()
        {
            MyInvoke mi = new MyInvoke(LoadData);
            this.BeginInvoke(mi);
        }修改前的代码:        private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            if (DialogResult.OK == MessageBox.Show("是否要修改", "", MessageBoxButtons.OKCancel))
            {
                Users user = new Users();
                user.UserName = this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
                user.Password = this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
                string sql = "update [用户表$] set 用户名='" + user.UserName + "',密码='" + user.Password + "' where 用户名='" + user.UserName + "'";
                int count = OledbHelper.ExecuteNonquery(sql);
                if (count == 1)
                {
                    MessageBox.Show("修改成功");
                    LoadData();
                }
            }
        }