title: How to set a string as nullable entity framework
body: <p>I'm getting this exception:</p>
  
  <blockquote>
    <p>The model backing the 'database' context has changed since the database was created. Consider using Code First Migrations to update the database (<a href="http://go.microsoft.com/fwlink/?LinkId=238269" rel="nofollow">http://go.microsoft.com/fwlink/?LinkId=238269</a>).</p>
  </blockquote>
  
  <p>As I have been told, that error comes when you change you model that represents the tables of you database and your database have not the same attributes(tables and fields)(correct me if I'm wrong).</p>
  
  <p><code>Tbl_Users</code>, which is in the database, has the following structure</p>
  
  <pre><code>dbUser(int,not null)//key
  dbUserId(varchar(50),null)//allow null, right?
  dbPassWord(varchar(20),null)
  </code></pre>
  
  <p>This is the model:</p>
  
  <pre><code>public class Tbl_Users {
      [Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public int dbUser { get; set; }
      [MaxLength(50)]
      public string dbPassWord { get; set; }
      [MaxLength(20)]
      public string dbUserID{ get; set; }
      public int? dbLock { get; set; }
  }
  </code></pre>
  
  <p>How can I set <code>public string dbPassWord { get; set; }</code> and <code>public string dbPassWord { get; set; }</code> to allow nulls? 
  Or is there any other solution for this error?</p>
  
  <p><strong>Update</strong></p>
  
  <p>If I add a migration, and I update the database with <code>Update-Database</code> as told <a href="http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-code-based-migrations-walkthrough.aspx" rel="nofollow">here</a>, will the values of the affected table be erased?</p>