title: wp8 DataBase doesn't work~
body: <p>I want use a database in my app, but there are some errors:</p>
  
  <blockquote>
    <p>An exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in Microsoft.Phone.Data.Internal.ni.dll but was not handled in user code</p>
    
    <p>If there is a handler for this exception, the program may be safely
    continued.</p>
  </blockquote>
  
  <p>It occurs on this:</p>
  
  <pre><code> if (true == db.PersonData.Any())
  </code></pre>
  
  <p>and</p>
  
  <pre><code>db.PersonData.InsertOnSubmit(newData);
  </code></pre>
  
  <p>The code worked on wp7....how do you fix it?</p>
  
  <p>Thx~</p>
  
  <pre><code>[Table]
  public class CPersonData
  {
      [Column]
      public string Lat { get; set; }
      [Column]
      public string Lon { get; set; }
  
      [Column]
      public string SelectShopType { get; set; }
  
      [Column]
      public DateTime UpdateTime { get; set; }
  }
  
  public class DataBase : DataContext
  {
      public Table&lt;CPersonData&gt; PersonData;
  
      public DataBase(string strConnection) : base(strConnection)
      {
          if (false == this.DatabaseExists())
              this.CreateDatabase();
      }
  }
  
  using (var db = new DataBase("Data Source=isostore:/FindTea.sdf"))
  {
      CPersonData newData = new CPersonData();
      newData.Lat = "";
      newData.Lon = "";
      newData.SelectShopType = "1,2,3";
      db.PersonData.InsertOnSubmit(newData);
      db.SubmitChanges(); 
  }
  </code></pre>