Insert / Update fields with empty string

Last post 01-08-2008 5:47 PM by marcind. 1 replies.

Sort Posts:

  • Insert / Update fields with empty string

    01-08-2008, 5:02 PM
    • Member
      12 point Member
    • EricSch
    • Member since 05-29-2006, 2:14 PM
    • Posts 5

    My underlying table has nvarchar fields with NOT NULL constraints.

    When I try to insert an empty string, a ASP.NET validator shows up -> The yyy field is required.

     Is there way to enter an empty string?

    Or do I need to change the generated code?

    Thanks

    Eric

  • Re: Insert / Update fields with empty string

    01-08-2008, 5:47 PM
    Answer
    • Contributor
      2,024 point Contributor
    • marcind
    • Member since 09-06-2007, 1:11 AM
    • Redmond, WA
    • Posts 410

    Hi Eric, 

    try using a DisplayFormatAttribute with ConvertEmptyStringToNull=false on your not null char fields.

    Marcin Dobosz
    SDE, ASP.NET Team, Microsoft
    Read my blog
Page 1 of 1 (2 items)