Let's say I have a table called adverts with the following fields:advert_id, name,date_created description,duration,status,user_id, cat_id.

Let's say a user puts a duration of 1 week in the duration field and its status is set to active. After a week has passed, the status is set to inactive in the table.

Can anyone tell me if it's possible to do this with asp.net 4.0 code using visual basic in visual studio 2010 with web forms?

You want the value in a field automatically changed after a certain period of time?

A few ways that come to mind. You can have a remote cron job call an asp.net page on a routine schedule. The only propose of this page is to run your code.

Here is another ..If the DB is being hosted on an edition such as SQL enterprise, you can have the SQL agent run a job on schedule. This job can execute a sql stored procedure to do what you need it to do to your records.

Also, in your global.asax page, you can leverage some of the various events that trigger (such as application start) to execute the code you need to.

Sound plausible, but if i could get some sample codes, that would be of great help to me

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.