Menu ▼

Previous Next

LINQ to SQL Delete :

Input tables
Department table
update

LINQ Query :

MyDBDataContext sqlObj = new MyDBDataContext();

tblDepartment dept = sqlObj.tblDepartments.Single(x => x.DepartmentID == 5);

sqlObj.tblDepartments.DeleteOnSubmit(dept);

sqlObj.SubmitChanges();


Output :
delete
Previous Next




Search dotnetlearners.com