listview中的删除行也按实体框架从数据库中删除 [英] Delete row in listview also delete from database by entity framework

查看:112
本文介绍了listview中的删除行也按实体框架从数据库中删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我有数据库连接实体框架并查看listview中的数据...

现在我想在listview1中选择行并按下按钮删除..

i想要删除listview1和表中的选定行..

对不起英语

Hi i have database connected with entity framework and see data in listview ...
now i want select row in listview1 and press button delete ..
i want delete selected row in listview1 and Table ..
sorry for bad english

推荐答案

虽然你的问题不明确,但我想你是想尝试从数据库中删除所选行!!!!它直接在删除按钮单击事件中获取所选行的唯一键或主键并发送到deleterecord()函数:



Though your question is not clear, I guess you are trying to delete the selected row from database !!!! Its straight forward in a delete button clicked event get the unique key or primary key of the selected row and sent to deleterecord() function:

deleteRecord(int uniqueKey)
{

//your delete code here 

 ... where table.id==uniqueKey

}


这篇关于listview中的删除行也按实体框架从数据库中删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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