locked
How to allow a table with non-nullable values to be null when the table is empty? RRS feed

  • Question

  • Hello Everyone, I'm new here, and this is my first post. Used the forums on MSDN PLENTY of times for info so I finally decided to join.

    Anyways, I'm working on a MVC3 project with SQL Server 2008 R2. In my database, I have a table that will store user input data, and some of the collumns are not allowed to be null. (They reference a project ID number, which is necessary to identify which Project they belong to) However, when I try to launch the application, I get an "EntityCommandCompliationException" error, and the inner exception is "Problem mapping fragments...Non-nullable collumn is mapped to a nullable entity property" (because there are no projects yet).

    How can I get around this to allow the collumns to be null if there is no data in the table?

    Thanks for the help!

    -Andy S.

    • Moved by Val Mazur Wednesday, May 16, 2012 8:12 PM (From:ADO.NET Managed Providers)
    Thursday, May 10, 2012 4:19 PM

All replies

  • Hi SuperStubbs,

    Welcome to MSDN Forum.

    Are you using Entity Framework?

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    Friday, May 11, 2012 3:24 AM
  • Hi SuperStubbs,

    Have you solved the issue? I'm looking forward to hearing from you.

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    Monday, May 14, 2012 2:19 AM