-
Feb 17th, 2012, 01:59 PM
#1
Thread Starter
Frenzied Member
[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
-
Feb 17th, 2012, 02:28 PM
#2
Thread Starter
Frenzied Member
Re: Can't find InsertOnSubmit() method
Finally found what was wrong, my Entity database was a dbmx file and not a dbml file.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|