Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi frends,
How to handle primay key,
1. if u added a new column in primary key[compisote key],
how this get affected in edms/code.
2.if a new column modification happend in db, how to handle in ef, code

please help learn in this.
Posted
Comments
Andy Lanng 15-Jun-15 4:45am    
This is why I never use composite primary keys. I always use an int identity(1,1) which is auto-updated. Can you use a unique key like this? It is much easier. You can still have unique keys that are not your primary key.
Tomas Takac 15-Jun-15 6:10am    
If you need to change the PK something is wrong. What you have there is probably the business key. You should use identity as Andy suggested. If you wish you can create a unique constraint in database for your business key. But don't use it as PK.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900