SampleDataContextDataContext db = new SampleDataContextDataContext();
Employee emp = new Employee()
{
FirstName = "Experts",
Lastname = "Comment",
Address = "alpha.beta@gmail.com"
};
db.Employees.InsertOnSubmit(emp);
db.SubmitChanges();
db.InsertEmployeeData("Experts","Comment", "alpha.beta@gmail.com");
Here I have created an store procedure with name InsertEmployeeData, and called it from the code. Simple and straight forward.
2. Create a Insert statement and execute using LINQ.
string insertStatement = "Insert into Employee values('Experts', 'Comment','alpha.beta@gmail.com')";
db.ExecuteQuery<Employee>(insertStatement);
Here I created normal insert query and executed using the the LINQ ExecuteQuery.