title: Problem trying to create database for windows phone app
body: <p>I'm trying to create a simple database to use sqlce in a windows phone app.
  I have a base class, and another set of classes that derive from it
  Here's what i got</p>
  
  <pre><code>public abstract class EntityBase : INotifyPropertyChanged
      {
          public event PropertyChangedEventHandler PropertyChanged;
  
          public void OnPropertyChanged(string property)
          {
              if (PropertyChanged != null)
              {
                  PropertyChanged(this, new PropertyChangedEventArgs(property));
              }
          }
  
          private int id;
  
          [Column(IsPrimaryKey = true, IsDbGenerated = true, DbType = "INT NOT NULL Identity", CanBeNull = false, AutoSync = AutoSync.OnInsert)]
          public int EntityId
          {
              get
              {
                  return id;
              }
              set
              {
                  if (id != value)
                  {
                      id = value;
                      OnPropertyChanged("Id");
                  }
              }
          }
      }
  
      [Table]
      public class Derived : EntityBase 
      {
          [Column]
          public string Description
          {
              get;
              set;
          }
      }
  </code></pre>
  
  <p>Then, I've got this class for datacontext purposes:</p>
  
  <pre><code>public class MyDataContext : DataContext
      {
          // Specify the connection string as a static, used in main page and app.xaml.
          public static string DBConnectionString = "Data Source=isostore:/ToDo.sdf";
  
          // Pass the connection string to the base class.
          public MyDataContext(string connectionString)
              : base(connectionString)
          { }
  
          public Table&lt;Derived&gt; Deriveds;
      }
  </code></pre>
  
  <p>And finally, here i'm trying to create the db :</p>
  
  <pre><code>private void Application_Launching(object sender, LaunchingEventArgs e)
          {
              using (MyDataContext db = new MyDataContext(MyDataContext.DBConnectionString))
              {
                  if (db.DatabaseExists() == false)
                  {
                      //Create the database -&gt; here's the error
                      db.CreateDatabase();
                  }
              }
          }
  </code></pre>
  
  <p>I'm getting the following error when trying to create the database :</p>
  
  <blockquote>
    <p>Invalid column ID. [ EntityId ]</p>
  </blockquote>
  
  <p>Yes, a very descriptive error message...
  Any ideas on what's wrong? I've been tampering around with the attributes in the column but to no avail.</p>
  
  <p>[EDIT] : for what i've been testing, if i put the EntityId property in the derived class, it doesn't crash. This can be 2 things.. one, that I'm missing something else in the base class, or the other one, that the column attribute for a primary key must belong to the class, and can't belong to the parent (which would be a extremely horrible design decision, we can't use inheritance???). if someone can confirm this that would be appreciated</p>