title: Xamarin.Android SQLiteException when inserting into the database
body: <p>i keep getting this error when trying to insert into my sqlite db.Other insertions work well,but it doesn't seem to go beyond this point.Has anyone encountered this error?how do you solve it?</p>
  
  <p>Below is the code and the Application output that shows the error.</p>
  
  <pre><code>    public long SaveSamplePoints(string endDate,string startDate,string Who,string altitude,string height)
      {
          double lat = 1.2607;
          double lon = 36.804;
          var dbconn =  new SQLiteConnection(dbHandler.WritableDatabase.Path) ;
      using(dbconn){
                   return dbconn.Insert (new SamplePointTable {
                   LATITUDE = lat,
                   LONGITUDE = lon,
  
                 });
        }
  </code></pre>
  
  <p>The output is as follows:</p>
  
  <pre><code>[DataActivity] SQLite.SQLiteException: Constraint
  [DataActivity]   at  SQLite.PreparedSqlLiteInsertCommand.ExecuteNonQuery (System.Object[] source)   [0x00000] in &lt;filename unknown&gt;:0 
  [DataActivity]   at SQLite.SQLiteConnection.Insert (System.Object obj,  System.String extra, System.Type objType) [0x00000] in &lt;filename unknown&gt;:0 
  </code></pre>
  
  <p><strong>EDIT</strong>
  This is what the SamplePointTable looks like:</p>
  
  <pre><code>[Table("Sample_Point")]
  public class SamplePointTable
  {
      // table sample points tags
  
      public static string TABLE_SAMPLE_POINT= "Sample_Point";
  
      [PrimaryKey, AutoIncrement,Column("_id")]
      public int SAMPLE_POINT_ID { get; set;}
  
  
  
      [Column("height")]
      public int HEIGHT{ get; set;}
  
      [Column("latitude")]
      public double LATITUDE { get; set;}
  
      [Column("longitude")]
      public double LONGITUDE { get; set;}
  
  
      [Column("start_date")]
      public DateTime START_DATE { get; set;}
  
      [Column("end_date")]
      public DateTime END_DATE{ get; set;}
  
      [Column("who")]
      public static string WHO { get; set;}
  
  
      [Column("user_id")]   //foreign key column
      public int USER_ID { get; set;}
  
  
          public static void OnCreate(SQLiteDatabase database){
  
      database.ExecSQL(CREATE_TABLE_SAMPLE_POINT);
  
      }
  
  public static void OnUpgrade(SQLiteDatabase database, int oldVersion,
          int newVersion) {
          Log.Warn(typeof(SamplePointTable).Name, "Upgrading database from version "
              + oldVersion + " to " + newVersion
              + ", which will destroy all old data");
          database.ExecSQL("DROP TABLE IF EXISTS " + TABLE_SAMPLE_POINT);
  
          OnCreate(database);
      }
  </code></pre>