本文介绍了如何将项目标记为已删除而不是最初从数据库中删除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 您好, 我有一个概念即 [1] 2个组合框combo1(显示来自数据库的项目),combo2 (显示标记为已删除的项目)n 1 listview控件(显示项目详细信息)在表单上。 [2]每当我点击删除按钮时,我都会从combo1 n中选择一个项目combo1中的项目被删除n将出现在combo2中,也从listview控件中删除但未从数据库本身删除..... [3]我hv试过很多技巧bt没有人给出合适的结果 plz help ....... 解决方案 如何将项目标记为已删除而不是最初从数据库中删除? 定义位的新列类型你的数据库永远记录在一个表中。 位字段将保存 true 或 false 。默认情况下,将此标志值设置为 false 以指示活动且有效。从前端删除后,将此字段设置为'' true ''以标记为已删除。 现在,在从DB中检索数据时,使用此字段作为WHERE子句条件之一,例如: - IsDelete 定义的BIT字段 SELECT * FROM myTable WHERE IsDelete = false Hello, I am having one concept i.e.[1] 2 combo boxes combo1(shows items from database) , combo2(shows marked as deleted items) n 1 listview control(shows items details) on form.[2] I select an item from combo1 n whenever I clicked delete button the item from combo1 gets removed n will be appeared in combo2 also removed from listview control but not deleted from the database itself.....[3] I hv tried lots of tricks bt no one gives appropriate resultplz help....... 解决方案 How to mark items as deleted not originally delete from database?Define a new column of bit type in your database for ever record in a table.Bit field will hold either true or false. By default, set this flag value as false to indicate active and valid. Once you delete it from frontend, set this field to ''true'' to mark as deleted.Now, during data retrieval from DB, use this field as one of the WHERE clause condition, ex:-- IsDelete is the BIT field definedSELECT * FROM myTable WHERE IsDelete = false 这篇关于如何将项目标记为已删除而不是最初从数据库中删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-06 03:33