i want delete data from my db date and time column current date into before 6 month data RRS feed

  • Question

  • i want answer from linq query
    Wednesday, April 3, 2019 7:51 AM

All replies

  • Hello,

    You have not provided sufficient information to provided assistance.

    You need to indicate what type of database, how are you currently accessing the database as there are at least a dozen ways to do this (Entity Framework, DataAdapter etc), how is the date column defined e.g. DateTime, String (yes some do this so I have to ask), what type of application etc. ???

    More information is better then less details.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    profile for Karen Payne on Stack Exchange

    Wednesday, April 3, 2019 10:22 AM
  • [i want delete data] i want answer from linq query

    I should point out that linq queries cannot delete data. The query only returns data. It doesn't modify anything in the database.

    You could use linq to select the data that is more than 6 months old, but then you would have to use something else to send the delete command to the database. As Karen mentioned, there are lots of ways to do this. And some of them do not make sense combined with linq. For instance, if you are sending a "delete" by means of ado.net, the condition would be in the statement itself and it would not make any sense to prefetch the data using linq. So, in summary, we need to know which is the way in which you are accessing your database.

    Thursday, April 4, 2019 6:30 AM

  • Hi   sakthidevi12334,

    Do you have any update?

    Besides, When you ask questions, please describe clearly and provide the corresponding steps and code when others need to reissue your questions. This will help people to analyze the problem better.

    Thank you for your understanding.

    Best Regards

    Yong Lu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 13, 2019 9:31 AM