Results 1 to 2 of 2

Thread: [RESOLVED] Can't find InsertOnSubmit() method

  1. #1

    Thread Starter
    Frenzied Member Zakary's Avatar
    Join Date
    Mar 2005
    Location
    Canada, Quebec, Montreal
    Posts
    1,654

    Resolved [RESOLVED] Can't find InsertOnSubmit() method

    I'm new to Entity Framework , and I'm think there is something that I misunderstand here.
    I'm trying to insert a row in a table, and everywhere I found code example, they call the method InsertOnSubmit(), but the problem is that I can't find anywhere the method InsertOnSubmit, or SubmitChanges.


    The error tell me:
    System.Data.Object.ObjectSet<WorkBench.tblConfig> do not contain the definition for InsertOnSubmit, ...

    What I'm doing wrong??


    http://msdn.microsoft.com/en-us/library/bb763516.aspx

    Code:
                GMR_DEVEntities CTX;
                CTX = new GMR_DEVEntities();
                tblConfig Config = new tblConfig { ID = Guid.NewGuid(), Code = "new config code" };
                CTX.tblConfigs.InsertOnSubmit(Config); // Error here

    Edit:
    Using Visual Studio 2010 on FW 4.0
    Last edited by Zakary; Feb 17th, 2012 at 02:05 PM.
    Using VS 2010 on Fw4.0

  2. #2

    Thread Starter
    Frenzied Member Zakary's Avatar
    Join Date
    Mar 2005
    Location
    Canada, Quebec, Montreal
    Posts
    1,654

    Re: Can't find InsertOnSubmit() method

    Finally found what was wrong, my Entity database was a dbmx file and not a dbml file.
    Using VS 2010 on Fw4.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width