Last post May 19, 2008 02:58 PM by topcatin
May 17, 2008 05:00 PM|oguzkaygun|LINK
i used to fileupload1 to save my picture and i saved it in table...how can i delete my record in table and my picture file in harddisk automatically after 3 months (i saved picture file and record date after 3 months) ?
could you write to me as visual basic code ? thank you for reading :)
code is below
Image2.ImageUrl = DestinationPath
SglDataSource2.InsertCommandType = SqlDataSourceCommandType.Text
rowsaffected = SglDataSource2.Insert()
Visual Web Developer 2008 Express Edition
May 19, 2008 02:58 PM|topcatin|LINK
The best would be to add a timestamp to your image.
in that format.
row_id can be your id of that record in the database.
To automatically delete, have a job scheduled to go and delete your records by using the above stamp and current date time int he database. -->this will work
not sure on the below but i think this is possible:
For the image, you can probably write a batch file which sees the current time and compare that with your time stamp and delete accordingly if it is 3 months old.
The best is:
Whenever your job is scheduled in the database, call the batch from SQL to remove your image.