在Windows窗体应用程序中删除选定的行 [英] deleting selected row in windows form application

查看:75
本文介绍了在Windows窗体应用程序中删除选定的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows窗体应用程序,其中我在数据网格中显示了表中的员工详细信息,并且在选择一行并单击删除按钮时有一个删除按钮,该行应基于员工ID删除.我创建了一个存储删除程序以及具有删除功能的类文件,之后请您提供指导.

I have a windows form application where i have displayed the table employee details in a datagrid and i have a delete button while selecting a row and clicking on delete button that row should be deleted based on employee id.I have created a stored procedure for delete and a class file where i have delete function could you please guide after that

推荐答案

您还需要什么指导?

进一步的步骤:
1.单击删除后,将所选行的EmployeeId传递到DB层(如果没有DB层,则可以.请记下该ID)
2.准备一个将更新数据库的SQL查询.使用您在WHERE子句中拥有的EmployeeId
3.执行后,用数据刷新网格-重新绑定网格或暂时将行从显示中删除

尝试!
What further guidance you need?

Steps further:
1. On delete click, pass on the selected row''s EmployeeId to DB layer (if no DB layer, ok. Just keep a note of this ID)
2. Prepare a SQL query that will update your database. Use the EmployeeId you have in your WHERE clause
3. Once executed, refresh your grid with data - either rebind your grid or remove the row from display for the time being

Try!


正如Sandeep Mewara写道:尝试!

在这里您可以找到一些帮助:
http://social.msdn.microsoft.com/Forums/pl-PL/adodotnetdataproviders/thread/e9d17dcf-55ce-4a67-9a56-f5955638e51e [ http://msdn.microsoft.com/en-us/library/ms171921%28v = vs.80%29.aspx [ ^ ]
http://support.microsoft.com/kb/310070 [ http://www.csharpfriends.com/articles/getarticle.aspx?articleid=78 [ ^ ]
As Sandeep Mewara wrote: TRY!

Here you can find a little help:
http://social.msdn.microsoft.com/Forums/pl-PL/adodotnetdataproviders/thread/e9d17dcf-55ce-4a67-9a56-f5955638e51e[^]
http://msdn.microsoft.com/en-us/library/ms171921%28v=vs.80%29.aspx[^]
http://support.microsoft.com/kb/310070[^]
http://www.csharpfriends.com/articles/getarticle.aspx?articleid=78[^]


这篇关于在Windows窗体应用程序中删除选定的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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