Menu ▼

Previous Next

LINQ to SQL Insert :

Input tables
Department table
departments

LINQ Query to Insert:

MyDBDataContext sqlObj = new MyDBDataContext();

tblDepartment dept = new tblDepartment();

dept.DepartmentName = "Deployment";

sqlObj.tblDepartments.InsertOnSubmit(dept);

sqlObj.SubmitChanges();


Output :
insert
Previous Next




Search dotnetlearners.com