
Code:
To delete an entity from EmpDetails table.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LINQ
{
class Program
{
static void Main(string[] args)
{
DataClassesDataContext dc = new DataClassesDataContext();
var empQuery = (from emp in dc.EmpDetails
where emp.ID == 1
select emp).First();
dc.EmpDetails.DeleteOnSubmit(empQuery);
dc.SubmitChanges();
}
}
}

Join the conversation! Your thoughts help the community grow.