Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi experts

I got a table in SQL Server 2008 has 10 columns and one of them is a computet column
(([FirstName]+n' ')+[LastName])


But when I try to insert a new object to the table with entityframework 4, it can't and an exception like computed column can not be null

But if I remove the column form the table it can be inserted.

I use .NETFramework 4 and Visual Stadio 2010

What can I do to solve this problem it's necessary to have computed column and EF4 doesn't work for this.
I don't want to use SP (Stored Procedure) too?
Posted
Updated 5-May-12 11:24am
v3
Comments
[no name] 5-May-12 8:07am    
If you have a constraint on the computed column that is cannot be null, remove the constraint.
Vartan Khachatourian 5-May-12 8:45am    
it's not null because firstname and lastname are not null
[no name] 5-May-12 8:47am    
What exactly does that have to do with a constraint on the database column?
Vartan Khachatourian 5-May-12 8:51am    
there is not any constraint on this column
[no name] 5-May-12 8:52am    
Well that is where you are getting that error.

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