如何通过使用datagrid视图中的按钮删除datagridview中的项目 [英] how to delete an item in datagridview by using the button in datagrid view

查看:86
本文介绍了如何通过使用datagrid视图中的按钮删除datagridview中的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi

实际上,我已经在C#.net Windows应用程序的datagridview中创建了button(delete),我的要求是,当用户单击datagridview中的delete中的按钮时,则应从访问2007中删除相应的数据,plz
发送信息,

hi

actually i had created the button(delete) in the datagridview in C#.net windows application , my requirement is that when the user clicks on the button in the delete in datagridview then that corresponding data should be deleted from the access 2007 , plz
send the information ,

推荐答案

尝试以下操作:
1.在按钮单击事件上,将其捕获并获取触发被删除的行.
2.根据该行,获取该行的唯一ID,该ID可用于从DB中删除该行
3.将唯一ID传递给DB层,然后传递给查询以从DB中删除记录
4.执行查询

完毕!现在先尝试.不要等待确切的代码.
Try this:
1. On button click event, trap it and get the row that was triggered to be deleted.
2. Based on the row, get the unique Id of the row that can be used to delete the row from DB
3. Pass on the unique ID to the DB layer and then to the query for deleting the record from DB
4. Execute the query

Done! Now try first. Don''t wait for exact code.


这篇关于如何通过使用datagrid视图中的按钮删除datagridview中的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆