Saturday, September 17, 2016

To delete the data from the table using linq c#


   public bool delete()
        {
            int res = 0;
            var query = dbcontext.taskdetails.Where(s => s.tid == 1).SingleOrDefault();
       
           dbcontext.taskdetails.Remove(query);

           res = dbcontext.SaveChanges();

           if (res > 0)
           {
               return true;
           }
           else
           {
               return false;
           }         
       
        }

No comments:

Post a Comment

Git Commands

Git Version   To check the git version Git -v       Git Clone To clone the repository, use the following command: Git clone [u...