LINQ 2 SQL Insert Error

Posted by Refracted Paladin on Stack Overflow See other posts from Stack Overflow or by Refracted Paladin
Published on 2010-05-27T13:37:34Z Indexed on 2010/05/27 13:41 UTC
Read the original article Hit count: 181

Filed under:
|
|
|
|

I have the below LINQ method that I use to create the empty EmploymentPLan. After that I simply UPDATE. For some reason this works perfectly for myself but for my users they are getting the following error -->

The target table 'dbo.tblEmploymentPrevocServices' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.

This application is a WinForm app that connects to a local SQL 2005 Express database.


public static Guid InsertEmptyEmploymentPlan(int planID, string user)
    {
        using (var context = MatrixDataContext.Create())
        {                               
            var empPlan = new tblEmploymentQuestionnaire
                                  {
                                      PlanID = planID,
                                      InsertDate = DateTime.Now,
                                      InsertUser = user,
                                      tblEmploymentJobDevelopmetService = new tblEmploymentJobDevelopmetService(),
                                      tblEmploymentPrevocService = new tblEmploymentPrevocService()
                                  };

                context.tblEmploymentQuestionnaires.InsertOnSubmit(empPlan);

                context.SubmitChanges();

            return empPlan.EmploymentQuestionnaireID;
        }
    }

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET