views:

108

answers:

1

We're adding some views to our entity framework model. Some fields in these views are nullable datetime2 datatypes in our sql server 2k8 db and the edmx is incorrectly showing these fields as being not null. Is this a known issue?

When I try to change them to not null it still throws the same error - because it appears as if the ssdl is defining it differently?

Has anyone run into this problem?

Edit: My exact error is:

The 'dateTimeAffected' property on 'V_myView' could not be set to a 'null' value. You must set this property to a non-null value of type 'DateTime'

Removing the view and adding it back in does not fix it as well... still marks the field as not nullable.

A: 

Sorry for this silly answer but you did delete the tables and add them again...for some reason ef4 does not refresh them properly...but ya not a known problem with ef4 it should show them as nullable...btw what error are you getting?

Misnomer
Yes, I tried this multiple times... still shows it as being nullable = false.... and marking it as an entity key. I also tried removing the entity that references the db table that the view is built upon
Chris Klepeis
The exact error is: The 'dateTimeAffected' property on 'V_myView' could not be set to a 'null' value. You must set this property to a non-null value of type 'DateTime'.
Chris Klepeis
hmm..sorry no idea..found this -http://forums.asp.net/t/1393277.aspx
Misnomer
and this -http://www.eggheadcafe.com/software/aspnet/29728971/nullable-object-must-have.aspx
Misnomer