Dim cmd As New SQLCommand
cmd.ConnectionName="cwgl"
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
If trv.SelectedNode IsNot Nothing
Dim Result As DialogResult
Result = MessageBox.Show("您真的要删除这个会计科目吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
cmd.CommandText = "delete for m {会计科目} where 科目编码 = '" & trv.SelectedNode & "'"
cmd.ExecuteNonQuery()
trv.SelectedNode.Delete
End If
Else
Messagebox.show("对不起,没有数据,无法删除!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
[此贴子已经被作者于2016/7/31 18:10:58编辑过]