本文介绍了有关删除的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的表单中有一个组合框和一个删除按钮。当我点击删除按钮时,我想从超过10,000的项目值中获取确认消息。

但是有一个错误。

这里是删除按钮的代码:

There is a combobox and a delete button in my form. when i click the delete button i want to get a confirmation message from the item values which are more than 10,000.
but there is an error.
here is my code for delete button:

Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
        If ds.Tables("ItemList").Rows(ComboBox1.SelectedIndex).Item(1) > 10000 Then
            MessageBox.Show("Do you really want to Delete this Record?", "Confirm Deletion", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)

            If DialogResult.No Then
                MsgBox("Operation Cancelled")
            Else
                Dim cb As New OleDb.OleDbCommandBuilder(da)
                ds.Tables("ItemList").Rows(ComboBox1.SelectedIndex).Delete()
                da.Update(ds, "ItemList")
                fillComboBox()

                Exit Sub
            End If
        End If



根据确认msg来的时候,如果我点击没有按钮,正确的消息来了。但如果我单击是按钮,该项应从组合框中删除。但是当我点击是按钮时项目没有删除

有人能找到我的问题吗?


according to that when the confirmation msg comes if i click no button the proper msg comes. but if i click the yes button the item should delete from the combobox. but the item doesn''t delete when i clicked yes button
can somebody find me the issue?

推荐答案


这篇关于有关删除的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 02:55