Click here to Skip to main content
14,836,361 members
Please Sign up or sign in to vote.
2.67/5 (3 votes)
See more:
how Delete all table data day by day using vb.net and sql searver??? please help me.tax
Posted
Comments
vaibhav mahajan 1-Mar-12 1:51am
   
do u want to delete data automatically..?..or with the user's interaction..?
Amal anjula 1-Mar-12 3:15am
   
without user.

Dear Amal,
Write the delete query in sqlcommand method and build the solution, you'll get one exe in Bin folder then assign this exe in windows scheduler as everyday running one.
F Y I, find the sample code,
VB
dim con as new Sqlconnection("your connection string")
con.Open()
Dim cmd As New SqlCommand("delete from tablename", con)
cmd.ExecuteNonQuery()
con.Close()


Regards,
Bluesathish
   
But you have to careful when you delete the data automatically. Archive the old data because it's useful sometimes & it'll save you from terrible situations.
How to archive data from my production databases?[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900