SQLite自动增量错误

时间:2016-11-27 12:17:27

标签: c# android visual-studio sqlite

我一直遇到运行Android应用程序的问题,因为我遇到了SQLite问题,

  

SQLite.SQLiteException:只允许在INTEGER PRIMARY KEY上使用AUTOINCREMENT

我已经听过各个论坛和网站的其他人的建议,并且他们都说要将INTEGER PRIMARY KEY的ROWID别名更改为其他内容。我当前的数据库架构如下所示,但在部署期间仍然出现错误。

如果有人能给我一些进一步的建议,我将不胜感激。

     public partial class CompletedExercise
     {
         [NotNull]
         public Int32 workoutID { get; set; }

         [NotNull]
         public Int32 exerciseID { get; set; }

         [NotNull]
         public String compDate { get; set; }

         [NotNull]
         public Int32 setNumber { get; set; }

         [NotNull]
         public Int32 repetitions { get; set; }

         [NotNull]
         public Double weight { get; set; }

     }

     public partial class Exercise
     {
         [PrimaryKey]
         public Int32 exerciseID { get; set; }

         [NotNull]
         public String exerciseName { get; set; }

     }

     public partial class Scheme
     {
         [PrimaryKey]
         public Int32 schemeID { get; set; }

         [NotNull]
         public String schemeName { get; set; }

         [NotNull]
         public String schemeDesc { get; set; }

     }

     public partial class Workout
     {
         [PrimaryKey]
         public Int32 workoutID { get; set; }

         [NotNull]
         public String workoutName { get; set; }

         [NotNull]
         public Int32 schemeID { get; set; }

     }

     public partial class WorkoutExercise
     {
         [NotNull]
         public Int32 workoutID { get; set; }

         [NotNull]
         public Int32 exerciseID { get; set; }

         [NotNull]
         public Int32 sets { get; set; }

         [NotNull]
         public Int32 repetitions { get; set; }

         [NotNull]
         public Double startingWeight { get; set; }

     }

0 个答案:

没有答案