Link to home
Create AccountLog in
Avatar of JoseHidalgo
JoseHidalgoFlag for Costa Rica

asked on

How to insert a record to a table without primary key using entity framework

Hi Experts

Could you please tell me if there is a way to insert a record to a table without primary key using entity framework.

Im getting the following error.

Unable to update the EntitySet 'companies' because it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element to support the current operation.

I cant add the PK becuase its an External Database I can Insert but I cant change the tables.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of ralmada
ralmada
Flag of Canada image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
>> Do you think that can be productive to spend more time doing research about this issue.<<

I'm trying to help here, so please try to reply professionally. thank you.

Avatar of JoseHidalgo

ASKER

Ralmada

Oh no no I think that Im not saying that your response is not helpful. It just that I have a deadline and Im working on it too. I was looking other places but I found similar responses.

if I was asking you about if it is productive to spend more time, it was because I was thinking that maybe this is the solution that many developers use.

I spend about 4 hours doing reaserch thats why Im not sure if there is another approach.

Thanks for your time Ralmada

We found this solution in many other places. I think this is the way to go.

Thanks