I'm trying to insert new records into a SQL CE 4 database with LINQPad and having problems with the identity problem of a table. Let's say I have this simple table for instance:
PEOPLE
Id int IDENTITY(1,1) NOT NULL,
Name nvarchar(100) NOT NULL
I may be doing things the wrong way but I tried this in LINQPad
People person = new Person { Name = "Bob" };
People.InsertOnSubmit(person);
SubmitChanges();
But I get a SqlCeException stating
"The colum cannot be modified. [ Column name = Id ]"
I can insert a record with SQL just fine, that works with no errors from SQL CE or its data provider and SQL CE sets the Id column for me which is what I'm wanting
INSERT INTO PEOPLE (Name) VALUES ('Bob');
Is there another step that I'm missing? I'm not even sure if its a LINQPad issue but thought I'd ask anyways since that's what I'm trying this code with right now.