如何从数据库中自动删除数据? [英] how to data remove automatically from database?

查看:147
本文介绍了如何从数据库中自动删除数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用数据库mysql数据库
我有数据发布日期时间和到期日期时间.

我想做的是到期日到来时我的数据库中的数据会自动删除

如何在asp.net Web应用程序中进行操作.

I uses database mysql database
I have data publication date time and expiry date time.

I want to do if expiry date come data delete automatically in my database

how to do in asp.net web application.

推荐答案

您需要创建一个SQL Server作业

http://msdn.microsoft.com/en-us/library/ms187910.aspx [ ^ ]
You need to create a SQL server job

http://msdn.microsoft.com/en-us/library/ms187910.aspx[^]


如果要通过检查规则&从应用程序执行删除操作,请执行以下操作:数据的完整性,那么您可以在应用程序中创建作业调度程序,并设置适当的时间来运行它.

在C#中有很多创建作业调度程序的方法,您可以尝试Quartz.Net或
您可以尝试以下文章:

C#计划程序 [
If you want to perform the delete operation from your application by checking rules & integrity of the data, then you can create a job scheduler in your application and set appropriate time to run it.

There are many ways of creating job schedulers in C#, you can try Quartz.Net or
you can try the article below:

C# Scheduler[^]


创建事件计划程序..
点击
[
Create Events Scheduler..
Click [^] to know more...


这篇关于如何从数据库中自动删除数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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